I really suck in bash scripting, so i'm hoping on your help guys. I need a script which will loop trough all folders, sub folders, sub sub folders, etc. inside folder /home/work and if there is present file Makefile then it should execute command make install
Folder structure is random, for example /home/work
- Dir 1
- - Dir 1.1
- - Dir 1.2
- - - Makefile
- Dir 2
- - Makefile
- Dir 3
- - Dir 3.1
- - Dir 3.2
- - - Dir 3.2.1
- - - Makefile
- - MakeFile
This is what i have so far
for f in /home/work/*;
do
[ -d $f ] && cd "$f" && echo Entering into $f && make install
done;
If you need any additional information's please let me know and i will provide.