#!/bin/bash # #$ -cwd #$ -j y #$ -P waxmanlab #$ -m be #$ -M kkarri@bu.edu #$ -N grep_GSE77729_R2_PB #$ -pe omp 8 #$ -l mem_per_core=1G #$ -l h_rt=24:00:00 echo "==========================================================" echo "Starting on : $(date)" echo "Running on node : $(hostname)" echo "Current job ID : $JOB_ID" echo "Current job name : $JOB_NAME" echo "Task index number : $TASK_ID" echo "==========================================================" source ~/.bashrc # Submit an array job with 3 tasks #$ -t 1-4 # Use the SGE_TASK_ID environment variable to select the appropriate input file from bash array # Bash array index starts from 0, so we need to subtract one from SGE_TASK_ID value inputs=(SRR3157440 SRR3157441 SRR3157442) index=$(($SGE_TASK_ID-1)) taskinput=${inputs[$index]} grep -E '@SRR*.*/2$' "$taskinput".fastq -A 3 > "$taskinput"_R2.fastq echo "Finished .............. $(date)"