Computing.Net > Forums > Linux > bash script which looks simple

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

bash script which looks simple

Reply to Message Icon

Name: yacob
Date: March 20, 2008 at 09:20:02 Pacific
OS: linux
CPU/Ram: 2GB
Product: linux
Comment:

I have a script as below which works out all the file in one directory with an extension of *.grb. It goes all those file and all sort of work is done in between, calling fortran code and a mix of call to GMT commands. Now I want to go to different subdirectories and do the same.

#!/bin/sh
for i in *.grb ;
do

# in between all sorts of command has been made here, not shown.

done

I want the above script to go through a subdirectories and looking files which ends *.grd. How can I do this ?

Regards
Yacob



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: March 27, 2008 at 21:17:47 Pacific
Reply:

you can try this


find /path -iname "*.grb" -print | while read -r file
do
#processing
done


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: bash script which looks simple

simple bash script www.computing.net/answers/linux/simple-bash-script/18032.html

How logout from login-menu bash script? www.computing.net/answers/linux/how-logout-from-loginmenu-bash-script/9016.html

Separating commands in bash scripts www.computing.net/answers/linux/separating-commands-in-bash-scripts/20341.html