Seems overly complicated.
How about;
file=$(ls -1 *.fastq |sed -n ${SGE_TASK_ID}p)
-Jeff
> On Sep 2, 2015, at 12:06 PM, Feng Zhang <[email protected]> wrote:
>
> Can you try to change the line:
>
> file=$(ls -1 *.fastq | tail -n +${SGE_TASK_ID}| head -1)
>
> to be :
>
> file=$(ls -1 *.fastq | tail -${SGE_TASK_ID}| head -1)
>
>
>
> On Wed, Sep 2, 2015 at 1:17 PM, VG <[email protected]> wrote:
>> HI everyone,
>>
>> I am trying to make a job array script. I have 2 files in my working
>> directory namely abc.fastq and def.fastq
>>
>> I want to run one command on these 2 files(later on I will include more
>> .fastq files) on different compute nodes. So I made this array script, but
>> it only produces output for abc.fastq.
>>
>> Here is the script:
>>
>> #!/bin/bash
>>
>> file=$(ls -1 *.fastq | tail -n +${SGE_TASK_ID}| head -1)
>> filename=${file%.fastq}
>> awk 'NR % 2 == 0{print substr($1,7,100)};NR % 2 ==1' $file >
>> ${filename}_BR.fastq
>>
>>
>> I submit it as qsub -cwd -j y -t 1-2 -N testjob ./script.sh
>>
>> But only abc.fastq file gets processed?:
>>
>> What am I doing wrong here?
>>
>> Hope to hear sonn from you guys.
>>
>> Thanks
>>
>> _______________________________________________
>> users mailing list
>> [email protected]
>> https://gridengine.org/mailman/listinfo/users
>>
>
>
>
> --
> Best,
>
> Feng
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users