Run .exe inside shell script | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Run .exe inside shell script

Shell Programming and Scripting


Tags
cygwin, exe, shell, windows

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-18-2013
HemanthJayasimh HemanthJayasimh is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 9 May 2013, 6:34 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Run .exe inside shell script

I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using

Code:
%BASH% --login -i "/cygdrive/d/script.sh"

, where %BASH% is an environment variable in Windows set to

Code:
C:\cygwin\bin\bash.exe

.
I have a created a Cygwin environment variable
Code:
$EXE_PATH = /cygdrive/d/somepath/dir

. Inside my script the line is

Code:
$EXE_PATH/some.exe -f /cygdrive/d/password.txt

There is error in this line every time I run the script. Error is something to do with the
Code:
some.exe/password.txt

not being found.
If I run the same command from the Cygwin terminal, it works fine. Is there something wrong with the environemnt variable or the way exe is executed, because of its argrument list? is this the right way to execute an exe inside a shell script?

---------- Post updated at 05:35 AM ---------- Previous update was at 05:31 AM ----------


Code:
#!/bin/sh
echo simple shell script
echo $EXE_PATH
$EXE_PATH/runube -f password.txt DVRP910 *ALL R0006P XJDE0001 QBATCH B #H S //NASRVNY/NY_02 --- this doesn't work
cat $TESTLEELA/password.txt --- this line works


Last edited by Scrutinizer; 01-18-2013 at 05:48 AM.. Reason: code tags
Sponsored Links
    #2  
Old 01-18-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 25 October 2014, 4:18 AM EDT
Location: NM
Posts: 10,251
Thanks: 283
Thanked 803 Times in 747 Posts

Code:
$EXE_PATH/runube -f /path/to/password.txt DVRP910 *ALL R0006P XJDE0001 QBATCH B #H S //NASRVNY/NY_02

You need a full explicit path to the password file.
Sponsored Links
    #3  
Old 01-18-2013
HemanthJayasimh HemanthJayasimh is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 9 May 2013, 6:34 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
i tried /cygdrive/d/password.txt . That doesnt work either.

---------- Post updated at 07:59 AM ---------- Previous update was at 06:36 AM ----------

Is this a problem with cygdrive ?? Is there anything else I can use to refer the path instead for cygdrive like mapping the D: drive or something
    #4  
Old 01-18-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 25 October 2014, 1:15 PM EDT
Location: Saskatchewan
Posts: 19,685
Thanks: 824
Thanked 3,352 Times in 3,139 Posts
Yes, try the literal Windows path. The cygdrive path might not matter until you're actually inside Cygwin.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Run perl script inside shell script ckchelladurai Shell Programming and Scripting 4 09-30-2011 05:08 AM
can I run a exe which is at bin dir from my script. rajkumar_g Shell Programming and Scripting 3 10-19-2010 08:32 AM
how to run shell script inside expect script? robbiezr Shell Programming and Scripting 1 05-06-2009 12:58 PM
How to run an SQL script inside a shell stevefox Shell Programming and Scripting 1 06-15-2006 10:11 PM
How to run unix commands in a new shell inside a shell script? hkapil Shell Programming and Scripting 2 01-04-2006 05:56 AM



All times are GMT -4. The time now is 03:41 PM.