#!/bin/bash
echo -n "Enter number of sanger patients : "; read id
cd 'C:\Users\cmccabe\Desktop\annovar'
perl -ne 'chomp; system ("perl table_annovar.pl $_ humandb/ -buildver hg19 -protocol refGene,popfreq_all,common,clinvar,clinvarsubmit,clinvarreference -operation g,f,f,f,f,f -otherinfo")' < file.txt
bash ~/sanger.sh
Enter number of sanger patients : 2
': not a valid identifierline 2: read: `id
: No such file or directoryne 3: cd: C:\Users\cmccabe\Desktop\annovar
/home/cmccabe/sanger.sh: line 4: file.txt: No such file or directory
Maybe:
while true
do
printf "Enter ID : " ; read id
[ -z "$id" ] && break
cd 'C:\Users\cmccabe\Desktop\annovar'
perl -ne 'chomp; system ("perl table_annovar.pl $_ humandb/ -buildver hg19 -protocol refGene,popfreq_all,common,clinvar,clinvarsubmit,clinvarreference -operation g,f,f,f,f,f -otherinfo")' < file.txt
done
I knew it the instant I saw your garbled error messages. They are garbled because the \r is sending the cursor to the beginning of the line without sending it down one line, causing partial overwrites.