I was trying to concatenate text files in sub-folders and tried:
cat ./{mainfolder1,mainfolder2,mainfolder3}/{subfolder1}/book.txt > out$var
However this did not return anything. So, tried adding a non existing 'subfolder2'
cat ./{mainfolder1,mainfolder2,mainfolder3}/{subfolder1,subfolder2}/book.txt > out$var
And this time it did work out, concatenating the files successfully. Why does this happens?
echo
instead ofcat
to see what command line you got. (Or useset -x
for debugging.)