[gradsusr] shell command within grads script

Muthuvel Chelliah - NOAA Federal muthuvel.chelliah at noaa.gov
Mon Oct 19 17:26:12 EDT 2020


Semyon, Jeff,

Thanks for the replies.

a) I know that the date command with the options I had asked, will give the
result at the grads command line with a ! before that command.

b) I also know the second round about way my manipulating the output
from the q time output (but how to do few days ago?).

I was only curious if there was a way from a) above, of possibly storing
that output in a variable as part of a grads script variable itself.
I guess, it is difficult, and not doable!!

Thanks again
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


On Mon, Oct 19, 2020 at 4:54 PM Jeff Duda <jeffduda319 at gmail.com> wrote:

> 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
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20201019/e3466cf4/attachment.html>


More information about the gradsusr mailing list