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

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.

主站蜘蛛池模板: 定远县| 友谊县| 松江区| 桦甸市| 密山市| 罗源县| 泽州县| 武胜县| 津南区| 宝应县| 西安市| 宁安市| 大埔县| 米林县| 甘南县| 和静县| 衢州市| 明溪县| 江川县| 新营市| 霍州市| 金山区| 洪泽县| 漳州市| 华安县| 辛集市| 贡嘎县| 日土县| 秦安县| 广河县| 林周县| 当阳市| 双桥区| 株洲县| 天津市| 休宁县| 突泉县| 柘荣县| 满城县| 平乐县| 保康县|