for i in `ls`
do
cd $i/host
cat "xxxx.txt" |grep "yyyy" >> zzzz.txt
done
I have a set of folder with different name and i need to extract a value from a file contained in the host subfolder ( that is present in each folder).
When i run the script it returns the following error
"No such file or directory", but actually it exists...
You are changing into directories and never changing back out. folder2 may exist, but it probably doesn't inside folder1! So do cd ../../ at the bottom of the loop to back back out.