Prof. J. E. Cremona on Thu, 15 Dec 2005 14:06:50 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

reading environment variables into gp?


It would be very helpful if a gp script could read the value of a (unix)
environment variable, into a string or integer variable.

For example, something like

s=getenv("MY_ENV_VAR");

would result in s being a string variable.  The C function getenv() does
this, so perhaps it would be simply a question of install-ing it?

Motivation:  I can run a script simultaneously on N processors in a
cluster;  the job on the i'th processor sets the environment variable
SGE_TASK_ID to the integer value i.  Now, I would like each job to know
the value of i so that I can select a parameter from a list -- so that
all processors can use the same script instead of having to edit N
separate ones.

Apologies if this is already possible -- I did look in the manual and
also searched the list archives!

John

-- 
 Prof. J. E. Cremona             |
 University of Nottingham        | Tel.:  +44-115-9514920
 School of Mathematical Sciences | Fax:   +44-115-9514951
 University Park                 | Email: John.Cremona@nottingham.ac.uk
 Nottingham NG7 2RD, UK          |


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.