小编use*_*040的帖子

在bash中将两个文件的内容合并到一个文件中

我有两个文件,其中包含以下内容

文件1

Line1file1
Line2file1
line3file1
line4file1
Run Code Online (Sandbox Code Playgroud)

文件2

Line1file2
Line2file2
line3file2
line4file2
Run Code Online (Sandbox Code Playgroud)

我希望将这些文件的内容合并到file3中

文件3

Line1file1
Line1file2
Line2file1
Line2file2
line3file1
line3file2
line4file1
line4file2
Run Code Online (Sandbox Code Playgroud)

如何在bash中从一个文件和另一个文件连续合并文件?

谢谢

linux bash merge awk sed

2
推荐指数
1
解决办法
9602
查看次数

读取bash和awk中的每一行文件

我有一个文件(test.txt),其中包含的内容

/the/path/foo.txt  foo.txt 
/the/paths/doo.txt  doo.txt 
/the/path/foo.pl  foo.pl 
/the/paths/doo.pl  doo.pl 
/the/path1/soo.csv  soo.csv
/the/path2/moo.csv  moo.csv
Run Code Online (Sandbox Code Playgroud)

我想将awk {print $ 1}保存到variable1并将awk {print $ 2}保存到bash脚本中的variable2,即variable1获取/the/path/foo.txt,variable2获取foo.txt等等

谢谢

bash shell awk

1
推荐指数
1
解决办法
81
查看次数

标签 统计

awk ×2

bash ×2

linux ×1

merge ×1

sed ×1

shell ×1