one more doubt:
#!/bin/bash
source /nfs_dir/grid/default/common/settings.sh
test(){
export CRASHLOG="/tmp/crash_log.txt"
}
test2()
{
export TEST_VAR=$CRASHLOG
rm -f $TEST_VAR
}
test
export -f test2
qrsh -v test -v test2 -now no -pty y "test2"

is the above process valid to pass CRASHLOG variable defined in test
function to test2


On Wed, Jun 5, 2013 at 1:03 AM, Ed Lauzier <[email protected]> wrote:

> Ah, ok.  This is good to know....
> -v works for functions....
>
> I hope we can get -V fixed sometime in the future.
> Users with large environments set up would like to have their functions
> if defined to be transferred across also...but there are workarounds...
> so no rush...
>
> -Ed
>
>
> -----Original Message-----
> *From:* Reuti [mailto:[email protected]]
> *Sent:* Tuesday, June 4, 2013 03:01 PM
> *To:* 'Vamsi Krishna'
> *Cc:* [email protected] Users
> *Subject:* Re: [gridengine users] function to submit inside bash script
>
> Am 04.06.2013 um 20:25 schrieb Vamsi Krishna: > Hi,
> >
> > i have function insdie bash script >
> #!/bin/bash >
> test(){ > echo "$HOSTNAME" > }
> > qrsh -V -now no -pty y test
> >
> > can i submit function using qrsh interactive way If you want to submit
> from inside a jobscript:
> - it's necessary to source the settings file in the script: source
> /usr/sge/default/common/settings.sh
> - the function needs to be exported: export -f test - the exechost needs
> to be also a submit host
> - due to a bug the -V won't allow (depending on the version of SGE) to
> export functions, but "-v test" will.
> (funny, I didn't notice the latter before)
> #!/bin/bash
> . /usr/sge/default/common/settings.sh
> test(){ echo "$HOSTNAME"; }
> export -f test qrsh -v test -now no -pty y test
> -- Reuti
> _______________________________________________ users mailing list
> [email protected] https://gridengine.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
>
>
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to