我有一個包含文件列表的文本文件。我想要cat
他們的內容在一起。做這個的最好方式是什麼?我正在做這樣的事情,但它似乎過於複雜:Bash:從文件列表中刪除多個文件
let count=0
while read -r LINE
do
[[ "$line" =~ ^#.*$ ]] && continue
if [ $count -ne 0 ] ; then
file="$LINE"
while read PLINE
do
echo $PLINE | cat - myfilejs > /tmp/out && mv /tmp/out myfile.js
done < $file
fi
let count++
done < tmp
我正在跳過註釋行和遇到問題。必須有更好的方法來做到這一點,沒有兩個循環。謝謝!
子集:http://stackoverflow.com/questions/864316/how-to-pipe-list-of-files - 通過查找命令返回查看所有文件 – 2017-05-10 09:32:09