I am developing a bash script in Windows 7 using a bash emulated terminal, exactly I use bash terminal in MobaXterm 9.1. The reason is that I have a Windows 7 laptop but my script would eventually run on a Jenkins Linux Server.
Spaces and/or ( in path are preventing my script from running successfully.
My script is:
#!/bin/bash
eclexe0="C:\Program Files (x86)\HPCCSystems\6.0.4\clienttools\bin\ecl.exe"
eclexe1="/drives/c/Program Files (x86)/HPCCSystems/6.0.4/clienttools/bin/ecl.exe"
clear
#1
echo "Testing if ecl.exe is available..."
if [ -f "$eclexe0" ]; then
echo "FOUND." >&2
else
echo "NOT FOUND." >&2
exit 1
fi
echo "Executing ecl.exe"
echo 1
eval "$eclexe0"
echo 2
When I run it the output is
As you can see script is not happy with path C:\Program Files (x86). If I move files to another path (C:\oscar\eclfolder) it works. I tried the answers here but they don't work, probably because I am in a Windows 7...
How can I make this script work?
eval
? You should just be able to do"$eclexe0"
. – Stephen Harris Sep 02 '16 at 15:30