- 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.
推薦閱讀
- Mastering Visual Studio 2017
- Java Web基礎與實例教程
- Monitoring Elasticsearch
- 基于Swift語言的iOS App 商業實戰教程
- Hands-On Full Stack Development with Go
- Haskell Data Analysis Cookbook
- Python項目實戰從入門到精通
- Scala編程(第5版)
- Python網絡爬蟲技術與應用
- Python計算機視覺和自然語言處理
- Simulation for Data Science with R
- C#面向對象程序設計(第2版)
- Arduino機器人系統設計及開發
- Mastering OAuth 2.0
- DB2SQL性能調優秘笈