http://www.shocr.com/linux-for-line-batch-replace-spaces-regular/
 

用三种解决方案来批量将换行改为空格,非常感谢柳城的帮助.

1.tr

cat gadgets.txt |tr "\n" " "

2.shell

for i in $(cat gadgets.txt);do echo -n "$i ";done

3.awk

 cat gadgets.txt|awk '{printf "%s ",$1}'

相关文章:

  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-08-03
  • 2021-12-23
猜你喜欢
  • 2022-02-13
  • 2021-11-01
  • 2022-01-07
  • 2022-02-09
  • 2022-12-23
  • 2021-09-27
  • 2021-11-29
相关资源
相似解决方案