I have a text file that holds a list of files. I want to cat
their contents together. What is the best way to do this? I was doing something like this but it
#!/bin/bash
files=()
while read; do
case "$REPLY" in
\#*|'') continue;;
*) files+=( "$REPLY" );;
esac
done < input
cat "${files[@]}"
What's better about this approach is that:
cat
, only gets executed once.