Batch file and perl


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Batch file and perl
# 8  
Old 11-29-2014
New batch file with the same result:

Path to cygwin exe is the first line
path to bash.exe with path to shell in the second line.

Code:
 set PATH=C:\cygwin\bin;%PATH%
    c:\cygwin\bin\bash.exe C:\cygwin\home\cmccabe\windows_annovar.sh

Cygwin opens and closes quickly. The sh file is attached in the previous post. Any suggestions? Thank you Smilie.

I placed a pause in the script and here is the error before cygwin closes:
Code:
C:\Users\cmccabe\Desktop>set PATH=C:\cygwin\bin\cygwin.exe;C:\Windows\system32;C
:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C
:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\
OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Bin
n\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Bin
n\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\
Microsoft SQL Server\100\DTS\Binn\

C:\Users\cmccabe\Desktop>c:\cygwin\bin\bash.exe C:\cygwin\home\cmccabe\windows_a
nnovar.sh
Press [Enter] key to continue...


Last edited by cmccabe; 11-29-2014 at 12:08 PM..
# 9  
Old 12-01-2014
Any suggestions for why this isn't working, I am at a loss. Thank you Smilie.
# 10  
Old 12-01-2014
When I use the following batch file the menu displays, but when a selection is made cygwin closes quickly.

Code:
 @echo off

C:
chdir C:\cygwin\bin\

bash --login -c "./windows_annovar.pl"
exit 0

I attached the .pl as well. Thank you Smilie.
# 11  
Old 12-01-2014
Did you try to remove the "exit" from your menu point 6, or at least put a "sleep 5" in front of it?
# 12  
Old 12-01-2014
The batch below seems to execute:

Code:
 set PATH=C:\cygwin\bin\;%PATH%
    c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch.sh

I attached the newbatch.sh, and here is a screenshot:

Code:
  
C:\Users\cmccabe\Desktop>set PATH=C:\cygwin\bin\;C:\Windows\system32;C:\Windows;
C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK
\2.0\bin\x64;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\
Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Prog
ram Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft
SQL Server\100\DTS\Binn\
C:\Users\cmccabe\Desktop>c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch.
sh
 MENU
    ==================================

         1  Match patient
         2  Sanger analysis
         3  Batch analysis
         4  Individual analysis
         5  Supplemental analysis
         6  Exit

    ==================================
         Your choice:

Why is the text before MENU appearing and how do I get rid of it or hide it? Thank you Smilie.
# 13  
Old 12-01-2014
Looks like it's "logging" your expanded set PATH command. Did you set sth. like bash's -v option's windows equivalent?
# 14  
Old 12-01-2014
I'm not sure how to do that.

Code:
 set PATH=C:\cygwin\bin\;%PATH%
    c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch.sh

to maybe

Code:
 set PATH=%PATH%;C:\cygwin\bin\;%PATH%
    c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch.sh

Thank you Smilie.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl error in batch command but works one at a time

In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :). ... (2 Replies)
Discussion started by: cmccabe
2 Replies

2. Shell Programming and Scripting

Renaming file in batch

Hi guys, I need a script to change the file names e.g.:- below are the mentioned files, i want t0 change the last character of the name 00000.cdr with e.g bep01.smsc.191214210500-00000.cdr to bep01.smsc.191214210500-92311.cdr next file be like bep01.smsc.191214210500-92312.cdr # ls -ltr... (9 Replies)
Discussion started by: mfaizan40
9 Replies

3. Shell Programming and Scripting

Perl: batch replace a portion of text in files

Hi all, What I would like to achieve is to batch change the code below in every pdf in a given directory (each pdf is uncompressed so that can be easily edited). An example of the javascript code: if (this.hostContainer) { try { this.hostContainer.postMessage(pp_216', 15259]);... (3 Replies)
Discussion started by: menteith
3 Replies

4. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

5. UNIX for Advanced & Expert Users

batch file

Hi all I am using tru64 Unix and I want a ready batch file which makes me to change all user passwords at the same time ,instead of changing everyone separately. Please could anyone help me to do that. bye. (1 Reply)
Discussion started by: ahmedbashir
1 Replies

6. Shell Programming and Scripting

Batch file to remove double quotes from a file

Hi I have to create a windows batch file which will read an input file and remove "double quotes" from each line of the file. For eg.If input file name is abcd.csv and contents is : "asasd,123123,213213,asd" "esfrf,dsfsdf,234324,sdfsdf" Then the batch file should remove "" from the... (11 Replies)
Discussion started by: akashtcs
11 Replies

7. UNIX for Advanced & Expert Users

Batch file question

EDIT: Is this wrong thread? Hi I am on an Apple Mac and I am trying to run this batch file on my Mac and was wondering if anyone could tell me what a script that will make this run and work on my Mac. I was hoping that you could tell me the script in the shell format? So here's the batch... (4 Replies)
Discussion started by: Billy5555100
4 Replies

8. Programming

batch file

what is a command to call a batch file from a c++ program when called with the argument which is a text file, then how to print that text file on a printer. please help me with code if possible (3 Replies)
Discussion started by: ramneek
3 Replies

9. IP Networking

batch file

my requirment is i have to call a batch file from a c++ program that batch file is called with the argument as print.txt print.txt is a text file which should get printed on printer (any printer) when a batch file call is made 1) how to call a batch file in c++ 2) how to print the text... (1 Reply)
Discussion started by: ramneek
1 Replies
Login or Register to Ask a Question