Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Bash menu not running

Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Bash menu not running perl code

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 Smilie.

Code:
 
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
}


Last edited by cmccabe; 03-27-2015 at 02:53 PM..
# 3  
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 Smilie.
# 4  
What do you expect your shell to do with
Code:
     my $FILENAME = 'L:\NGS\3_BUSINESS\Matrix\Torrent\matrix_${id}.txt';

?
And what with
Code:
     $( perl -ne 'chomp; system ("perl ~/matrix.pl < ./${id}.txt.hg19_multianno.txt")' > )$FILENAME) )

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 perljust run "system" with another perl call.
# 5  
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 Smilie.

Code:
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
}

# 6  
Help me out - in that perl line - what it the result of (opening parentheses - closing parentheses)?
# 7  
I'm not sure which one you are referring to but the $( perl - ne is how I call a perl script in bash.

Does this help?
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Bash Menu using zenity
allen11
Hi, I'm new to bash, and have an example menu script using Zenity. It works fine if the user enters A B or C, but if the user enters nothing, I can only figure out how to exit the script. How do I get the menu to reappear if no input is selected? The script is: title="Select example"...... Shell Programming and Scripting
2
Shell Programming and Scripting
Simple bash script menu
fusetrips
Dear Sir, May I know how do I go about adding the following feature into the script below: When user enter values other than 1,2,3,4, a) Message “Wrong entry !!! Pls select 1,2,3 or 4” is displayed b) The screen is cleared again and the menu is displayed. #!/bin/bash clear var=1...... UNIX for Dummies Questions & Answers
2
UNIX for Dummies Questions & Answers
get chosen value from bash menu
olearydc
Hi again :) This is just a sample whiptail menu. Works great, but have been trying to get the chosen value into a variable but failing pretty bad...its ther but unsure how to echo it out when needed #! /bin/bash #This is the menu whiptail --title "Menu example" --menu "Choose an...... Shell Programming and Scripting
9
Shell Programming and Scripting
Help regarding a bash menu script
Vitrophyre
Greetings all, I'm having some trouble writing a menu drive bash script, actually coding the menu part was not difficult however its a problem with a menu option I'm having trouble with. My menu has 5 options, when the user selects the second option, they are then prompted to enter a number from...... Shell Programming and Scripting
5
Shell Programming and Scripting
Bash menu script
AngelFlesh
I have a main menu quit=n while do clear echo echo "1. General system information" echo "2. Hardware utilisation information" echo "3. File management" echo "4. User information" echo "5. Information on network connectivity" echo "6. Information on processes" echo "Q.Quit" ...... Shell Programming and Scripting
3
Shell Programming and Scripting

Featured Tech Videos