<html>
<body>
the simplest way is to redirect shell output to a file (!date >/tmp/x), <br>
then read it (<a href="http://cola.gmu.edu/grads/gadoc/script.html">http://cola.gmu.edu/grads/gadoc/script.html</a>) <br>
<br>
in opengrads there is at least one extension (I wrote one) that gets <br>
the output of external commands, but if you don't know about extensions <br>
the first solution may be faster to implement <br>
<br>
Bye bye <br>
Davide <br>
<br>
On Mon, 2020-10-19 at 17:26 -0400, Muthuvel Chelliah - NOAA Federal <br>
wrote: <br>
<font color="#000000">> Semyon, Jeff, </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">> Thanks for the replies. </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">> a) I know that the date command with the options I had asked, will </font><br>
<font color="#000000">> give the </font><br>
<font color="#000000">> result at the grads command line with a ! before that command. </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">> b) I also know the second round about way my manipulating the output </font><br>
<font color="#000000">> from the q time output (but how to do few days ago?). </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">> I was only curious if there was a way from a) above, of possibly </font><br>
<font color="#000000">> storing  </font><br>
<font color="#000000">> that output in a variable as part of a grads script variable itself. </font><br>
<font color="#000000">> I guess, it is difficult, and not doable!!  </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">> Thanks again </font><br>
<font color="#000000">> Muthu </font><br>
<font color="#000000">>   </font><br>
<font color="#000000">> ------------------------------------------------ </font><br>
<font color="#000000">> Dr. Muthuvel Chelliah, eMail: <a href="mailto:Muthuvel.Chelliah@noaa.gov">Muthuvel.Chelliah@noaa.gov</a> </font><br>
<font color="#000000">> Rm. 3008, Climate Prediction Center, Ph: (301) 683-3393 </font><br>
<font color="#000000">> NCEP/NWS/NOAA/U.S.Dept.of Commerce, </font><br>
<font color="#000000">> 5830, University Research Court, NCWCP, </font><br>
<font color="#000000">> College Park, MD 20740 </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">>  </font><br>
<font color="#000000">> On Mon, Oct 19, 2020 at 4:54 PM Jeff Duda <<a href="mailto:jeffduda319@gmail.com">jeffduda319@gmail.com</a>> </font><br>
<font color="#000000">> wrote: </font><br>
<font color="#000000">> > You can try prompting the linux command with "!" and hopefully the </font><br>
<font color="#000000">> > script recognizes the result and stores it properly. </font><br>
<font color="#000000">> >  </font><br>
<font color="#000000">> > I see that you're attempting to do something that would require </font><br>
<font color="#000000">> > lots of code in a grads script, but hopefully you know that you can </font><br>
<font color="#000000">> > query the valid time of data using 'q time' and parse the data </font><br>
<font color="#000000">> > using the 'sublin()', 'subwrd()', and 'substr()' functions internal </font><br>
<font color="#000000">> > to GrADS' scripting language. </font><br>
<font color="#000000">> >  </font><br>
<font color="#000000">> > Jeff Duda </font><br>
<font color="#000000">> >  </font><br>
<font color="#000000">> > On Mon, Oct 19, 2020 at 1:56 PM Muthuvel Chelliah - NOAA Federal < </font><br>
<font color="#000000">> > <a href="mailto:muthuvel.chelliah@noaa.gov">muthuvel.chelliah@noaa.gov</a>> wrote: </font><br>
<font color="#000000">> > > Hello folks, </font><br>
<font color="#000000">> > >  </font><br>
<font color="#000000">> > > How can I set the result of the following linux shell command </font><br>
<font color="#000000">> > > to a variable (time_var) within a Cola grads script? which can be </font><br>
<font color="#000000">> > > assigned </font><br>
<font color="#000000">> > > to set time command, via 'set time 'time_var </font><br>
<font color="#000000">> > >  </font><br>
<font color="#000000">> > > date -d "3 days ago" +%d%b%Y </font><br>
<font color="#000000">> > >  </font><br>
<font color="#000000">> > > Thanks </font><br>
<font color="#000000">> > > Muthu </font><br>
<font color="#000000">> > > ------------------------------------------------ </font><br>
<font color="#000000">> > > Dr. Muthuvel Chelliah, eMail: <a href="mailto:Muthuvel.Chelliah@noaa.gov">Muthuvel.Chelliah@noaa.gov</a> </font><br>
<font color="#000000">> > > Rm. 3008, Climate Prediction Center, Ph: (301) 683-3393 </font><br>
<font color="#000000">> > > NCEP/NWS/NOAA/U.S.Dept.of Commerce, </font><br>
<font color="#000000">> > > 5830, University Research Court, NCWCP, </font><br>
<font color="#000000">> > > College Park, MD 20740 </font><br>
<font color="#000000">> > > _______________________________________________ </font><br>
<font color="#000000">> > > gradsusr mailing list </font><br>
<font color="#000000">> > > <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> </font><br>
<font color="#000000">> > > <a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a> </font><br>
<font color="#000000">> >  </font><br>
<font color="#000000">> >  </font><br>
<font color="#000000">> > _______________________________________________ </font><br>
<font color="#000000">> > gradsusr mailing list </font><br>
<font color="#000000">> > <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> </font><br>
<font color="#000000">> > <a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a> </font><br>
<br>

<BR />
<BR />
<font face="Arial" color="#ff0000" style size="1">Attenzione ARPAL ha cambiato indirizzi digitali, i nuovi indirizzi di e-mail sono composti dall'attuale nome.cognome seguito da @arpal.liguria.it, quindi nome.cognome@arpal.liguria.it</font><BR />
</body>
</html>