SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samtools "is recognized as '*'" "truncated file" error axiom7 Bioinformatics 3 11-26-2014 02:53 AM
MiSeq gDNA reads still fail "Kmer content" and "per base seq content" after trimming" ysnapus Illumina/Solexa 4 11-12-2014 07:25 AM
DEXSeq error in estimateDispersions: match.arg(start.method, c("log(y)", "mean")) fpadilla Bioinformatics 14 07-03-2013 02:11 PM
"Systems biology and administration" & "Genome generation: no engineering allowed" seb567 Bioinformatics 0 05-25-2010 12:19 PM

Reply
 
Thread Tools
Old 04-02-2019, 12:38 AM   #1
deKoch13
Member
 
Location: HD

Join Date: Mar 2019
Posts: 12
Default Bash Error "Unexpected token near done"

Hi!

I wrote the following little bash script:
Code:
echo Processing...

inputDir="/home/j490h/localhome/fastq/"
output_folder="/home/j490h/localhome/fastq/textfiles/"

for input_FASTQfile in `ls ${inputDir}/*fastq*`
do
        filename_only=`basename ${input_FASTQfile}`
	echo ${filename_only}
	zcat ${filename_only} | sed -n '1~4p' > ${output_folder}/${filename_only}_ReadIDs.txt
done

output_folder2="/home/j490h/localhome/fastq/textfiles/combined_textfiles/"
trimmed="trimmed"
shuffled="shuffled"
reconstructed="reconstructed"

for file1 in `ls ${output_folder}/*txt*`
do
	for file2 in `ls ${output_folder}/*txt*` 
	do
		if [ ${trimmed} in ${file1} & ${file2} ]
		then 
			cat ${file1} ${file2} > ${output_folder2}/${file1}_${file2}_combined.txt
		elif [ ${shuffled} in ${file1} & ${file2} ]
		then
			cat ${file1} ${file2} > ${output_folder2}/${file1}_${file2}_combined.txt
		elif [ ${reconstructed} in ${file1} & ${file2} ]
		then
			cat ${file1} ${file2} > ${output_folder2}/${file1}_${file2}_combined.txt
		else
			echo Invalid input FASTQfile
	done
done
and I get the error:
"Unexpected token near done" at the last two lines.
Unfortunately, I dont know why...
I already checked cat -v file.sh, but there do not seem to be unexpected characters or something...

Do you have any idea?

Greetings!

Last edited by GenoMax; 04-02-2019 at 11:26 AM.
deKoch13 is offline   Reply With Quote
Old 04-02-2019, 10:03 AM   #2
dsenalik
Carrot Scientist
 
Location: Madison WI USA

Join Date: Nov 2009
Posts: 42
Default

I believe you are missing a
fi
line before the last two done lines
dsenalik is offline   Reply With Quote
Reply

Tags
bash, error

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 07:32 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO