Hi I'm using SUN Grid Engine to submit jobs, written by shell script like this:
#!/bin/bash #$ -pe single 24 #$ -V #$ -cwd #$ -o $HOME/sge_jobs_output/sge_job.$JOB_ID.out -j y #$ -S /bin/bash #$ -l mem_free=8G cd $HOME/scratch/bwa2/ job_number=$SGE_TASK_ID SAM_NAME_1=`head -"$job_number" master_list_1|tail -1` /share/bin/bwa aln hg19_index "$SAM_NAME_1".recal.fastq.gz > "$SAM_NAME_1".sai #Do sth. here to save the output as text file. Here by output I don't mean # .sai file, but the error report like "10000000 sequences have been processed", #And text file name is SAM_NAME_1, which is a variable
Maybe I didn't make quite clear. As shown as the end of the script, I want to put some command so that the error report can be saved as .txt file. How can I do that? (I know we can use > .txt at prompt; but here the .txt file name is a variable, so I must put command within script)
WHat I want is similar to $HOME/sgejobsoutput/sgejob.$JOBID.out -j y; but I want name as SAMNAME instead of JOBID. Thanks!
SO actually this turned out as a bioinformatic problem. :)
#$ -e $HOME/sge_jobs_output/sge_job.$SAM_NAME_1.txt
But it still doesn't work..$SAMNAME1 part doesn't act as variable..
Is there any other way, which does NOT rely on this SGE flag? thx