![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with While []... done in bash | musta1234 | Bioinformatics | 7 | 04-08-2014 06:08 PM |
bash help | Liy | Bioinformatics | 5 | 01-28-2014 07:22 AM |
Float Arithmatic in Bash | vishal.rossi | Bioinformatics | 3 | 05-06-2013 02:34 AM |
New to BAsh. Encountered an error | vishal.rossi | Bioinformatics | 4 | 04-26-2013 08:34 PM |
Running stampy in bash script | grafab | Bioinformatics | 7 | 04-23-2012 03:00 AM |
![]() |
|
Thread Tools |
![]() |
#1 |
Member
Location: MO, USA Join Date: Apr 2011
Posts: 83
|
![]()
I tried to do a simple task in batch--unzipping many gz files. I have many .gz files, but how come it only unzipped one file then finished? Anything wrong with my script? thanks. John
## unzip fastq.gz for i in *.fastq.gz do #echo $i zcat "$i" > "${i%.*}" done |
![]() |
![]() |
![]() |
#2 |
Member
Location: Brazil Join Date: Dec 2009
Posts: 24
|
![]()
have you tried 'gunzip *.fastq.gz' ?
|
![]() |
![]() |
![]() |
#3 |
Member
Location: MO, USA Join Date: Apr 2011
Posts: 83
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Location: Brazil Join Date: Dec 2009
Posts: 24
|
![]()
for i in `ls *.fastq.gz`; do gunzip -c $i > $i.fastq; done
|
![]() |
![]() |
![]() |
#5 |
Member
Location: MO, USA Join Date: Apr 2011
Posts: 83
|
![]() |
![]() |
![]() |
![]() |
#6 |
Member
Location: Brazil Join Date: Dec 2009
Posts: 24
|
![]()
I tested your version of the command and it worked fine. It could be something related to permissions.
|
![]() |
![]() |
![]() |
#7 |
Member
Location: MO, USA Join Date: Apr 2011
Posts: 83
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Location: bethesda Join Date: Feb 2009
Posts: 700
|
![]()
for i in $(ls *.gz); do sn=`echo $i | sed 's/\.gz$//'`; zcat $i > $sn; done;
|
![]() |
![]() |
![]() |
#9 |
Member
Location: MO, USA Join Date: Apr 2011
Posts: 83
|
![]()
another nice way to do it.
I really think something is going on with my server. It still finished after doing one file. I will ask my admin tomorrow. Will let you know. By any chance did this happen to any one of you here? |
![]() |
![]() |
![]() |
Thread Tools | |
|
|