我有一个包含文件列表的文本文件。我想要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