[gradsusr] Grads Bash scripting

Jeffrey Duda jdduda at iastate.edu
Wed Sep 1 13:50:33 EDT 2010


Meredith,
Try making your grads script a function by adding the following lines before
and after the regular grads script code:

function main(args)
YY = subwrd(args,1)
name = subwrd(args,2)

...script code....

return

When you call Grads in your script, call it like you are doing pretty much:

grads -lbxc "(script name) ${argument1} ${argument2} ..."

The grads script done this way should include the argument list in the bash
script as the input arguments to the Grads function in your script.

Jeff Duda

On Wed, Sep 1, 2010 at 11:30 AM, Meredith Croke <mcroke at airdat.com> wrote:

> Thanks for everyones input.. Its somewhat working.  I say somewhat because
> it seems like grads is getting hung up, the bash script opens grads but then
> it just stops, I took it out of batch mode in the hopes of seeing more
> detail, but no luck.  I also tried it with the variables before and after
> the run command:
>
> /export/grads/bin/gradsc -lc 'run /lustre-sas1/automate/RTFDDA_track.gs
> "${yyyy} | ${name}"'
>
> And in my grads script I have at the very top:
> pull data
> YY=subwrd(data,1)
> name=subwrd(data,2)
> say 'heres my name and date: 'name' 'YY
> 'open
> /lustre-sata1/data/cycles/grib_output/'YY'/grads/tropfdda0/tropfdda0.ctl'
>
> I'm not even seeing the say command.
>
> Thanks again for all your help.
>
> Meredith
>
>
-- 
Jeff Duda
Iowa State University
Meteorology Graduate Student
3134 Agronomy Hall
www.meteor.iastate.edu/~jdduda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100901/49cbfb59/attachment-0003.html 


More information about the gradsusr mailing list