[GE users] env variables usage question

Alessio Terpin aterpin at aoes.com
Wed Dec 17 09:26:24 GMT 2008


Henry, Mark Patrick wrote:

Hi Henry,

here is my test script to pass the enviroment, I hope that it's hope

#!/bin/sh
export MY_ENV_VAR="test_-V_options"
qsub Test_with_enviroment.sh
-bash-3.2$ more Test_with_enviroment.sh
#!/bin/sh
#
# Simple test script to submit job by SGE
#
# !) #$ is the way to pass parameter to SGE wrapper
#
# Have the ouptut file in the CWD
#
#$  -cwd
#
# send a email at the end of the job
#
#$ -m e
#
#$ -M aterpin at aoes.com
#
# Preserve the enviroment
#$ -V

echo "hello from `hostname`"
echo "This is MY_ENV_VAR = $MY_ENV_VAR"
sleep 20
ls /tmp/get/a/error

Moreover you can pass the enviroment with ssh
User file ~/.ssh/enviroment

-bash-3.2$ more ~/.ssh/environment
# Test for NOinteractive ssh
# to made openMpi to work
PATH=/opt/OpenMpi/gnu/bin:/usr/bin:/bin/
LD_LIBRARY_PATH=/opt/OpenMpi/gnu/lib

Ssh configuration
in /etc/ssh/sshd_configuration add the following line

PermitUserEnvironment yes

I hope, that is useful

Alessio



> Hi All,
>
> Can't find a clear explanation on this in the manuals or online.. I'd appreciate any help.
>
> I'm trying to use shell env. variables in a sge script, including the parameter variables ($* etc) when submitted via qsub or a qrsh batch submission and its not working as I would expect, or at all in fact.
>
> For example,
>
> -- submission cmd --
>
> qrsh -V -now -q queue1 -b n ./myscript arg1 arg2
>
>
> --- myscript --
>
> #!/usr/bin/ksh
>
> # Send mail to these users
> #$ -M $LOGNAME at mailserver.local.com
>
> # Mail at beginning/end/on suspension
> #$ -m bes
>
> # auto-name the job based on params
> #$ -N "$LOGNAME: first: $1, second: $2"
>
> # pass on all the args to the actual build script
> build_script $*
>
>
> So, pretty simple.. I just want to pass through some parameters from the user cmd submission into the script and on to the actual build script later.  Also, I'd like to be able to use other vars in the users environment to give a customized email message while having a single script for everyone.
>
> It seems that -V would be the mechanism to do this, but it doesn't seem to fly.  Running GE v6.1
>
> If there are any alternate suggestions too, that'd be appreciated.
>
> Many thanks,
>
> -Mark
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=92848
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].
>   


-- 
AOES                    | Alessio Terpin : Unix System Administrator
Huygensstraat 34        | Tel : +31 (0) 71 579 55 519 
2201 DK Noordwijk (ZH)  | Fax : +31 (0) 71 572 12 77
The Netherlands         | WebSite www.aoes.com

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=92922

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list