【sed】sed 中如何替换换行符

2023-05-10  本文已影响0人  Bogon

$ ansible -i hosts all -m shell -a "/usr/sbin/ip addr | grep -A 3 'eth0:' | grep link/ether | awk '{print $2}'" | awk '{print $1}' | tr 'a-z' 'A-Z' | tr ':' '-'

image.png

sed 中如何替换换行符
https://www.cnblogs.com/luobosong/p/3915769.html

How can I replace each newline (\n) with a space using sed?
https://stackoverflow.com/questions/1251999/how-can-i-replace-each-newline-n-with-a-space-using-sed

上一篇下一篇

猜你喜欢

热点阅读