access to Unix environment variables from within grads scripting language

Diane Stokes Diane.Stokes at NOAA.GOV
Tue Jul 18 11:57:43 EDT 2006


My mistake.  It only looked like it was working.  ...Sloppy on my part.

From:  http://grads.iges.org/grads/gadoc/gradcomdshell.html

"If the shell command is executed from a Grads script, the output will
not [be] returned as a string buffer to the script."

Sorry to get your hopes up.
   Diane



bernd.becker at METOFFICE.GOV.UK wrote:
> But Diane,
>
> '!echo $base'
> base=result
> say base
>
> does not yield the anticipated result.
> Bernd
>
>
>
> On Fri, 2006-06-23 at 15:14, Diane Stokes wrote:
>> The following works for me:
>>
>> '!echo $base'
>> say result
>>
>>
>>     Diane
>>
>>
>> bernd.becker at METOFFICE.GOV.UK wrote:
>>> Hello!
>>>
>>> I would like to access System environment variables
>>> during run time of a grads script.
>>> The following function doddle allows me to do that,
>>> but it doesn't look nice.
>>>
>>> How can I make the following code much slicker?
>>> Regards,
>>> Bernd.
>>>
>>> function doddle ()
>>> '!echo $base >./erp1'
>>> record2=read(erp1)
>>> result=sublin(record2,2)
>>> rc=close(erp1)
>>> say result
>>> quit
>>> return
>>> --
>>> Bernd Becker   The Monthly Outlook
>>> Met Office  FitzRoy Road  Exeter   Devon EX1 3PB  United Kingdom
>>> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
>>> E-mail:bernd.becker at metoffice.gov.uk -  http://www.metoffice.gov.uk
>>>
>> --
>> Diane Stokes
>> Environmental Modeling Center
>> National Weather Service/NOAA
> --
> Bernd Becker   The Monthly Outlook
> Met Office  FitzRoy Road  Exeter   Devon EX1 3PB  United Kingdom
> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
> E-mail:bernd.becker at metoffice.gov.uk -  http://www.metoffice.gov.uk
>

--
Diane Stokes
Environmental Modeling Center
National Weather Service/NOAA



More information about the gradsusr mailing list