10
rated 0 times
[
10]
[
0]
/ answers: 1 / hits: 65837
/ 2 Years ago, tue, november 29, 2022, 9:51:30
I have a bash script install.sh
in my current directory and I have a directory apps
which contains multiple directories. I want to loop through these sub directories in app folder and execute some script. After executing script in first folder it should come back and enter into next folder. I have tried this but it's skipping one after another. I mean it's entering into all odd folders and not entering into even folders.
Code in install.sh
for f in apps/*;
do
[ -d $f ] && cd "$f" && echo Entering into $f and installing packages
cd ..
done;
More From » command-line