[GE users] [Fwd: How to get the script name]
Mark.Olesen at faurecia.com
Thu Mar 4 09:47:56 GMT 2010
On Thu, 2010-03-04 at 00:31 -0800, jeepster wrote:
> Also wish to know this.
> At my company, job submission uses qsub -n
> so $REQUEST does not give original script name.
> But I notice that a qstat -j command gives
> "job_name:" which is what qsub named, but also
> "script_file:" which is full path of the script file.
> Unfortuately, can not access this from the script
> running inside SGE....
Script=$(qstat -j $JOB_ID | sed -ne 's/^script_file: *//p')
echo "This script is '$Script'"
Since most of our scripts are generated on-the-fly (via Perl) and fed to
qsub, the above always returns "STDIN" for us, which is not really
If you have flat spooling, you can notice that the
spool/qmaster/job_scripts/$JOB_ID will contain the content of the script
You could get at the information like this:
spoolDir=$(sed -ne 's/^qmaster_spool_dir *//p' \
Otherwise if you simply wish to use the script recursively (we do this
for adding embedded Perl into the job shell script), you can simply use
the normal $0 variable.
Presumably one of these will help you further.
This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited. Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.
To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].
More information about the gridengine-users