Home > Net >  How to get all stderr within a for loop?
How to get all stderr within a for loop?

Time:03-08

I want the stderr of all files within a for-loop. So far only the first one in the for loop was written into summary.txt.

My codes:

SAMPLES="SRR1 SRR2 SRR3 SRR4"
    
 for SAMPLE in $SAMPLES; do hisat2 -p 24 -x /home/genome_g7b -1   /home/${SAMPLE}_1_val_1.fq -2 /home/${SAMPLE}_1_val_2.fq -S ${SAMPLE}.sam | 2>summary.txt

done

CodePudding user response:

You redirect the file descriptor for all commands within the loop.

for anything in anything; do
    anything
done 2>summary.txt
  • Related