[GE users] qsub and environment vars

rich rich at thevillas.eclipse.co.uk
Tue Jun 20 16:13:03 BST 2006


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Hi,

I have a small shell script for submitting jobs via qsub.
When I call this script directly everything is fine, but when i call it 
with qsub nothing gets assigned to the variables
QBLAST and BLAST_BY_ID. ie I have to explicitly set their values. Does 
qsub run under a different user ID that might cause 'which' not to find 
the path?

Thanks
Rich


#!/bin/sh

# Run blast on each line of a fasta file separately

# Execute from cwd
#$ -cwd

# Mail at end
#$ -m e


#QBLAST=`which qblast`
QBLAST='/home/richard/scripts/qblast'
#BLAST_BY_ID=`which blast_by_id`
BLAST_BY_ID='/home/richard/scripts/blast_by_id'


if [ $# -gt 2 ]
then

   if [ "$1" == "-batch" ]
   then
       #"batch mode"
       shift
       $BLAST_BY_ID $@


   else   
       #"submit mode"      
       records=`fgrep '>' $1 | wc -l`
       echo "Found $records sequences in $1"
       qsub -p 100 -t 1-$records $QBLAST -batch $@

   fi

else
    echo "Usage: qblast fasta_file blast_executable blast_args";
fi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list