IFS=$'\n'
for CITY in $(cat /home/user/CT.txt)
do
FILES=/mnt/dir1/dir2/$CITY/*
count=0
folder=''
for f in $FILES
do
echo "Processing $f file..."
((count++))
folder=$f
# take action on each file. $f store current file name
#cat $f
done
Below is CT.txt content and directory structures :
cat CT.txt
Test1 Test2 Test3
cd Test1/
|_dir1
exm.xls
cd Test2
|_dir1
exm.xls
Output should:
i want only dir inside files should process under Test1 Test2 excluding .xls file