我有一个文件1,其中包含:aaaaaaabbbbbbbccccccc
文件2:dddddddeeeeeeefffffff
文件号:ggggggghhhhhhhiiiiiii
如何使用regex shell linux预添加thisistheresult
并生成如下结果文件:thisistheresultaaaaaaa,bbbbbbb,cccccccthisistheresultddddddd,eeeeeee,fffffffthisistheresultggggggg,hhhhhhh,iiiiiii
谢谢你的帮助!
最佳答案
使用paste
和sed
:
paste -s file* -d',' | sed 's/^/thisistheresult/'