Hi all,
This bash loop works for one user on a machine, but not for another, when pasted into the terminal (note the indenting)
for F in *_1.fastq.gz;
do
stem=$(echo $F | sed 's/_.\+//');
cutadapt -a AGATCGGAAGAGCACACGTCTG -A AGATCGGAAGAGCGTCGTGTAG -o ${stem}_1.trim.fastq -p ${stem}_2.trim.fastq ${stem}_1.fastq.gz ${stem}_2.fastq.gz;
gzip ${stem}_1.trim.fastq &
gzip ${stem}_2.trim.fastq &
done
For both users, echo $SHELL returns "/bin/bash"
The following loop works for both users when pasted into the terminal (note different indenting
for F in *_1.fastq.gz;
do
stem=$(echo $F | sed 's/_.\+//');
cutadapt -a AGATCGGAAGAGCACACGTCTG -A AGATCGGAAGAGCGTCGTGTAG -o ${stem}_1.trim.fastq -p ${stem}_2.trim.fastq ${stem}_1.fastq.gz ${stem}_2.fastq.gz;
gzip ${stem}_1.trim.fastq &
gzip ${stem}_2.trim.fastq &
done
but *both* versions work when placed in a shell script and invoked with
bash ./ThisScript.sh
Why is this?
Thanks,
D.
--
Darren Obbard
darren...@ed.ac.uk
Institute of Evolutionary Biology
University of Edinburgh
Room 2.09, Ashworth 2, Charlotte Auerbach Road
EdinburghEH9 3FL
Office 0131 651 7781
Mobile: 07968 838 635
http://obbard.bio.ed.ac.uk/
-------------------------------------------------------------------
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.