1

I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using %BASH% --login -i "/cygdrive/d/script.sh", where %BASH% is an environment variable in Windows set to C:\cygwin\bin\bash.exe.

The above script executes without any problem. But when there are Cygwin environment variables inside the .sh files then it doesn't work.

For example, I have a created a Cygwin environment variable $EXE_PATH = /cygdrive/d/somepath/dir. Inside my script the line is

$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 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 /cygdrive?

Here is the script

#!/bin/sh 
#TESTLEELA=/cygdrive/d 
echo simple shell script 

echo $EXE_PATH 

$EXE_PATH/runube.exe -f $TESTLEELA/password.txt DVRP910 *ALL R0006P XJDE0001 QBATCH B H S //NASRVNY1
4

1 回答 1

0

换行

$EXE_PATH = /cygdrive/d/somepath/dir

EXE_PATH=/cygdrive/d/somepath/dir   (in cygwin shell script)
于 2013-01-17T13:38:43.563 回答