[gradsusr] shell command within grads script
Jeff Duda
jeffduda319 at gmail.com
Mon Oct 19 16:36:37 EDT 2020
You can try prompting the linux command with "!" and hopefully the script
recognizes the result and stores it properly.
I see that you're attempting to do something that would require lots of
code in a grads script, but hopefully you know that you can query the valid
time of data using 'q time' and parse the data using the 'sublin()',
'subwrd()', and 'substr()' functions internal to GrADS' scripting language.
Jeff Duda
On Mon, Oct 19, 2020 at 1:56 PM Muthuvel Chelliah - NOAA Federal <
muthuvel.chelliah at noaa.gov> wrote:
> Hello folks,
>
> How can I set the result of the following linux shell command
> to a variable (time_var) within a Cola grads script? which can be assigned
> to set time command, via 'set time 'time_var
>
> date -d "3 days ago" +%d%b%Y
>
> Thanks
> Muthu
> ------------------------------------------------
> Dr. Muthuvel Chelliah, eMail: Muthuvel.Chelliah at noaa.gov
> Rm. 3008, Climate Prediction Center, Ph: (301) 683-3393
> NCEP/NWS/NOAA/U.S.Dept.of Commerce,
> 5830, University Research Court, NCWCP,
> College Park, MD 20740
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Jeff Duda, Research Scientist
University of Colorado Boulder
Cooperative Institute for Research in Environmental Sciences
NOAA/OAR/ESRL/Global Systems Laboratory
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20201019/88d13075/attachment.html>
More information about the gradsusr
mailing list