我经常用谷歌搜索它。我只想要这一行:
echo "Replace <newLine> it by <newLine> NEWLINE <newLine> in my OSX terminal <newLine> and bash script" | sed -e 's/<newLine>/\n/g'
在我的 osx 终端和 bash 脚本中工作。我不能使用sed
为了这?还有另一种单线解决方案吗?
这里使用sed
echo "Replace <newLine> it by <newLine> NEWLINE <newLine> in my OSX terminal <newLine> and bash script" | sed 's/<newLine>/\'$'\n/g'
这是一篇博文解释了原因 -https://nlfiedler.github.io/2010/12/05/newlines-in-sed-on-mac.html https://nlfiedler.github.io/2010/12/05/newlines-in-sed-on-mac.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)