I'm trying to loop over different subdirectories and fetch the files.but getting "no such file found exception"
For example : structure is like tmp/app1/app1a/some.yml and tmp/app1/app2a/some.txt tmp/app1/app2a/dirr
Ex2
tmp/app2/app2a/some.txt tmp/app2/app2a/dirrr tmp/app3/some.txt
My goal is to fetch all the files which are having "debug" String.
For this I started initially to fetch a file from subdirectories.
Cd ~
Cd /home/dir
ls | xargs -L 1 -d '\n' | while read a
do
cd $a
ls | xargs -L 1 -d '\n' | while read b
do
cd $b
ls | xargs -L 1 -d '\n' | while read c
do
temp='cat $c | egrep "debug|DEBUG" | awk '{print $1}''
echo $temp >> /dirr/example.txt
done
done
done
This is just an example where I'm trying to find the correct loop.
Please ignore typo errors in code.
Using bash to code.