|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Yes, try the literal Windows path. The cygdrive path might not matter until you're actually inside Cygwin.
|
| Sponsored Links | ||
|
![]() |
| Tags |
| cygwin, exe, shell, windows |
| Thread Tools | Search this Thread |
| 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 |
|
|