- 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.
推薦閱讀
- Kali Linux Web Penetration Testing Cookbook
- 垃圾回收的算法與實現(xiàn)
- 劍指JVM:虛擬機實踐與性能調(diào)優(yōu)
- Java Web及其框架技術(shù)
- JavaScript by Example
- 批調(diào)度與網(wǎng)絡(luò)問題的組合算法
- 學(xué)習(xí)OpenCV 4:基于Python的算法實戰(zhàn)
- 一塊面包板玩轉(zhuǎn)Arduino編程
- Python Interviews
- 大學(xué)計算機基礎(chǔ)實訓(xùn)教程
- SFML Game Development
- Learning Apache Thrift
- Java核心技術(shù)速學(xué)版(第3版)
- C#程序設(shè)計基礎(chǔ)與實踐
- 從0到1:jQuery快速上手