Recently I started working with shell scripting in Linux (newbie). I wanted to know the commands or the procedure to change from one folder to another within the loop? I mean how can I call different folders inside the executing loop? Presently, I'm renaming all the folders with no's say 1,2,3..... and using these inside the loop. I know this is not a good way to use scripting.
set k=1
while ( $k <= 17)
## initial path set
cd /home/naren/Documents/BASELINE_INSP/FreeSurfer/$k/RSFC
Each time 'k' updates, move to different folders since I named all folders as no's.