The perl command is not executing? I am trying to run the .pl in my cygwin home directory (C:\cygwin\home\cmccabe) using ${id}.txt.hg19_multianno.txt (located in the annovar directory) as the input file to be formatted and $FILENAME is the output file to be saved. The .pl is attached as well. Thank you :).
matrix() {
printf "\n\n"
cd 'C:\Users\cmccabe\Desktop\annovar'
my $FILENAME = 'L:\NGS\3_BUSINESS\Matrix\Torrent\matrix_${id}.txt';
$( perl -ne 'chomp; system ("perl ~/matrix.pl < ./${id}.txt.hg19_multianno.txt")' > )$FILENAME) )
printf "Process complete and new file saved in ($FILENAME), Are there additional target gene patients? Y/N "; read match_choice
case "$match_choice" in
[yY]) id=""; menu ;;
[nN]) id=""; printf "\n Goodbye! /n/n " ;;
esac
}
The bash menu runs now, but the perl command hangs up and doesn't run. I mix between so many different shell scripting because many of the programs that I use are academic and open-source, written in a specific language. Thank you :).
Me, I don't have the slightest clue of perl , but I'd doubt it accepts four closing parentheses when it had only two opening ones. And I'd doubt it to be efficient to have perl just run "system" with another perl call.
The hope was to store the output directory as a variable ($FILENAME) but I don't think that is the right way to do it. I changed the code to the below and put the .pl in the annovar directory to make it easier.
The overall goal is use ${id}.txt.hg19_multianno.txt as the input file and after the perl script is run on that file the output file is saved to the path L:\NGS\3_BUSINESS\Matrix\Torrent\matrix_${id}.txt . Thank you :).
matrix() {
cd 'C:\Users\cmccabe\Desktop\annovar'
$( perl -ne 'chomp; system ("perl matrix.pl < ${id}.txt.hg19_multianno.txt" )' >> L:\NGS\3_BUSINESS\Matrix\Torrent\matrix_${id}.txt
printf "Process complete and new file saved in, Are there additional target gene patients? Y/N "; read match_choice
case "$match_choice" in
[yY]) id=""; menu ;;
[nN]) id=""; printf "\n Goodbye! /n/n "; sleep 2 && exit ;;
esac
}
Now that you mention it I don't think this is the correct approach. The $( perl -ne...) allows me to run a use a batch file with the perl script. But that's not what I'm trying to do so its back to the drawing board. Thank you