file.txt内容如下:
1 1
2 2
3 3
4 4
5 5
file1.txt的内容如下:
###
***
@@@
$$$
%%%
$awk '1;NR==3{while(getline<"file1")print}' file
结果如下:
1 1
2 2
3 3
###
***
@@@
$$$
%%%
4 4
5 5
将文件内容追加到行尾并用tab隔开
if [ "$(file last_dianji.txt | awk '{print $2}')" == "empty" ] ; then paste dianji.txt last_dianji.txt >> last_dianji.txt; else paste dianji.txt last_dianji.txt >> last_dianji.txt; sed -i '1d' last_dianji.txt; fi
阅读(549) | 评论(0) | 转发(0) |