[gradsusr] Grads Bash scripting

Don.VanDyke at noaa.gov Don.VanDyke at noaa.gov
Tue Aug 31 17:02:24 EDT 2010


Hi Meredith,

To go from bash to GrADS, try doing something like this.  In your bash script, add a line like this....

echo ${yyyy} | /export/grads/bin/gradsc -blc "run gs.sf.surface.wind_mps"

In your gs.sf.surface.wind_mps script, at the very top, add these lines....

pull data
yyyy=subwrd(data,1)

Then you can reference the yyyy in the rest of the GrADS script like this....
'draw title Testing 'yyyy' year'

Hope this helps some.

Don Van Dyke
NWS Tallahassee, FL

----- Original Message -----
From: Meredith Croke <mcroke at airdat.com>
Date: Tuesday, August 31, 2010 4:39 pm
Subject: [gradsusr] Grads Bash scripting
To: gradsusr at gradsusr.org


> Hi,
>  
> I am trying to write a bash script that will read values from a
> tc-vitals file and feed it into my grads script.   Can anyone give me
> tips on how to do this?  I'm not sure how to feed the varibales from
> bash into grads.   I have tried doing this in a bunch of different ways
> and searched the users forum but I can't find any good examples.  Here's
> one example, trying to have the date read in grads: 
> in bash:
>  
> yyyy=$(date +%Y%m%d$hh)
> /export/grads/bin/gradsc -blc 'run gs.sf.surface.wind_mps'
>  
> in grads 
> date= yyyy
> (i've tried 'yyyy' and $yyyy)
>  
> what else do I need to put in bash or in my grads script to recognize
> that yyyy= 2010083112 ?
>  
> Any help is greatly appreciated.
>  
> Meredith
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> 



More information about the gradsusr mailing list