[GE users] qsub -terse on array jobs

Olesen, Mark Mark.Olesen at emcontechnologies.com
Wed Nov 12 12:40:05 GMT 2008

> I just noticed, that in 6.2 the option -terse will output:
> $ qsub -terse -t 1-10 test.sh
> 471.1-10:1
> is it supposed to be this way? I would expect the job id and nothing
> more. As this way you need a script again to get rid of the ".1-10:"
> if you want the output to be used for another command.
> Opinions?

It might look silly, and I don't really need it now, but I think it
could be useful at some point.

I wouldn't use a script to cleanse it though.
If you use a pipe,
   qsub -terse -t 1-10 test.sh | sed -e 's/\..*$//'
the qsub return code gets trashed.

I think this would be better:
   job_id=$(qsub -terse -t 1-10 test.sh)

If you need the plain job id:
   echo "job_id=${job_id%.*}"

or in-place style change:

If you want to get at the task_id information:
   echo "task_ids=${job_id##*.}"

or get at the step-size (for whatever reason):
   echo "step=${job_id##*:}"

I'll leave the extraction of min, max taskIds as an exercise for the
reader ;)

This e-mail message and any attachments may contain 
legally privileged, confidential or proprietary Information, 
or information otherwise protected by law of EMCON 
Technologies, its affiliates, or third parties. This notice 
serves as marking of its "Confidential" status as defined 
in any confidentiality agreements concerning the sender 
and recipient. If you are not the intended recipient(s), 
or the employee or agent responsible for delivery of this 
message to the intended recipient(s), you are hereby 
notified that any dissemination, distribution or copying 
of this e-mail message is strictly prohibited. 
If you have received this message in error, please 
immediately notify the sender and delete this e-mail 
message from your computer.


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

More information about the gridengine-users mailing list