Computing.Net > Forums > Unix > small script

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.

small script

Reply to Message Icon

Name: yacob
Date: March 20, 2008 at 06:12:29 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: nails
Date: March 20, 2008 at 11:14:22 Pacific
Reply:

I'd use the find command:


#!/bin/ksh

find . -type f -name "*.gdb" -print|while read i
do
echo $i
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 Unix Forum Home


Sponsored links

Ads by Google


Results for: small script

small script www.computing.net/answers/unix/small-script/6319.html

Small Script www.computing.net/answers/unix/small-script/6996.html

Command Script www.computing.net/answers/unix/command-script/4337.html