官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 梅河口市| 治县。| 新郑市| 义马市| 柞水县| 乐平市| 土默特左旗| 桓台县| 弥勒县| 娱乐| 滕州市| 岑巩县| 山西省| 焦作市| 郧西县| 略阳县| 陵水| 武夷山市| 增城市| 湘潭县| 永登县| 曲松县| 镇巴县| 邻水| 贵南县| 科尔| 桐乡市| 娄烦县| 桂平市| 南充市| 通城县| 鄱阳县| 黄石市| 商河县| 太谷县| 彩票| 商洛市| 新宁县| 高台县| 宁化县| 绥芬河市|