示例文件:abc.ksh
我想要
作为输出。
echo "This is a sample file." >> mno.txt
echo "\nThis line has new line char." >> mno.txt
我想要
echo "\nThis line has new line char." >> mno.txt
作为输出。
grep '\\n' abc.ksh
- 不用谢 :-) - Anders R. Bystrupgrep -F '\n' abc.ksh
也可以工作,-F
告诉 grep 将模式视为固定字符串。 - Josh Jollyfgrep \n mno.txt
- User5910n
;而在其他的shell中,它会写入一个真正的换行符。 - undefined