access to Unix environment variables from within grads scripting language

Diane Stokes Diane.Stokes at NOAA.GOV
Fri Jun 23 10:14:48 EDT 2006


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



More information about the gradsusr mailing list