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

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.

主站蜘蛛池模板: 高青县| 吉隆县| 西华县| 桐庐县| 钟祥市| 邯郸市| 西乡县| 尼玛县| 巴青县| 大庆市| 新闻| 沅陵县| 灵宝市| 漾濞| 武穴市| 轮台县| 平远县| 平谷区| 罗江县| 黎城县| 淮安市| 文昌市| 台北市| 瑞昌市| 黄陵县| 山东省| 增城市| 元谋县| 墨江| 威宁| 荆门市| 西林县| 宁都县| 调兵山市| 湖北省| 丘北县| 岳池县| 宜良县| 五家渠市| 西贡区| 吉隆县|