使用脚本
问题描述:
猫从同一线路上的其他文件的串联一个文件test1.txt的使用脚本
abc
猫的test2.txt
def
我有以上两个文件,并试图追加的test2.txt到test1.txt但每次它追加到新行,我试图从网上找到解决方案,但无法得到正确的答案,请让我知道是否有人可以帮我找到解决方案
我想要ou tput的这种格式 输出:"abc,def"
在test1.txt文件
试图与猫和echo命令,在网络给出可能的解决办法,但它不工作
答
[[email protected] tmp]$ cat test1
abc
[[email protected] tmp]$ cat test2
def
[[email protected] tmp]$ paste -d "," test1 test2
abc,def
[[email protected] tmp]$ pr -mtJS"," test1 test2
abc,def
很好地利用未充分利用的'pr'效用++ – anubhava