I am trying to cat
4 files one directory down to a new file, also one directory down:
cat ./dira/file.txt ./dirb/file.txt ./dirc/file.txt ./dird/file.txt > ./dire/file.txt
I can get this to work from the Terminal, but not in the following:
for i in `ls -d prefix*`
do
cd $i
pwd
cat ./dira/file.txt ./dirb/file.txt ./dirc/file.txt ./dird/file.txt > ./dire/file.txt
done
where pwd
prints the correct directory. I get the error: -bash: : command not found
.