- Perl 6 Deep Dive
- Andrew Shitov
- 73字
- 2021-07-03 00:05:44
The -n command
The -n command-line option creates a loop so that the program is executed once for every line of the text submitted to the input of the program.
It may be, for example, a one-line utility that prints the first letter of the strings from the STDIN input:
perl6 -n -e'print $_.substr(0, 1)' < file.txt
It will print the line composed from the first characters of the lines in file.txt.
推薦閱讀
- LaTeX Cookbook
- arc42 by Example
- 深入實踐Spring Boot
- 從0到1:HTML+CSS快速上手
- MATLAB定量決策五大類問題
- PHP+MySQL+Dreamweaver動態網站開發實例教程
- Unity 5 for Android Essentials
- Illustrator CC平面設計實戰從入門到精通(視頻自學全彩版)
- 軟件體系結構
- Backbone.js Testing
- Visual C++開發寶典
- 少年小魚的魔法之旅:神奇的Python
- 計算機應用基礎
- Mastering React Test:Driven Development
- Flask Web開發實戰:入門、進階與原理解析