I want to make a report which is the concatenation of several .txt files. I wrote this bash code (~/scripts/report.sh)
echo "Display content of files in /etc/ directory"
for file in $(find ~/Research/reports/August/ -name '*.txt' -type f) ;
do
echo "############START OF FILE#########"
echo ${file}
echo " "
cat ${file}
echo "##########END OF FILE########"
echo " "
done
but I get the error:
'home/vdonchev/scripts/report.sh: line 2: syntax error near unexpected token `
'home/vdonchev/scripts/report.sh: line 2: `for file in $(find ~/Research/reports/August/ -name '*.txt' -type f) ;
I don't understand what is wrong: when I call only
find ~/Research/reports/August/ -name '*.txt' -type f
it works and indeed lists my .txt files.
Thanks in advance.