Cannot figure this one our or create a sample which can reproduce this.
Am trying using an external sh file to invoke the hadoop sh file
myfile.sh
# workingdir = /data1/some/path/lib
WORKINGDIR=`cygpath -p -w -m "$WORKINGDIR"`
# so the above in windows land is C:/some/path/lib
# HADOOPCMD essentially is a call to hadoop.sh
$HADOOPCMD jar $WORKINGDIR/myjar.jar
hadoop.sh
echo "$@" // still C:/some/path/lib
exec "$JAVA" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"
However when "$@" is expanded in cygwin the resultant path becomes C:\some\path\lib and then the hadoop.sh complaints that it cannot find the jar ... Not a valid JAR : C:\some\path\lib
However if I were to hardcode the path in myfile.sh ; it works
$HADOOPCMD jar C:/some/path/lib/myjar.jar
Question
Quoting the variable works "$WORKINGDIR"/myjar.jar