Bash code change

I have the below bash which runs great. Before I make a change I wanted to check with experts (as I am not one). After the perl code completes, I am going to display "annotation complete" then go into the remove function .

 
annovar() {
    # combine id and position files
	cd 'C:\Users\cmccabe\Desktop\annovar'
	cp out_parse.txt "$(cat target.txt)"
	
	# run annotation
              $( 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 ")' < target.txt )
			  
     printf "The annotation is complete, would you like analyze additional target gene patients? Y/N "; read match_choice
	 case "$match_choice" in
        [yY]) id="${id}"; menu ;;
        [nN]) id="${id}"; remove ;;
		esac
} 

My question is will something like this work: Thank you :).

annovar() {
    # combine id and position files
	cd 'C:\Users\cmccabe\Desktop\annovar'
	cp out_parse.txt "$(cat target.txt)"
	
	# run annotation
              $( 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 ")' < target.txt )
			  
     printf "The annotation is complete "; remove
	  esac
}

You've left in the esac for the case statement which you've deleted.

1 Like

Thank you :slight_smile: