I have created a simple shell script which executes another shell script within the same directory. Both scripts work without issue when executed outside of cygwin, but when I execute the file in mintty, I get a "No such file or directory" error.
I have tried altering the line in the script executed first to access the second script in several ways such as . ./script2.sh
and ./script2.sh
with the same results.
NOTE 1: I realize there are several similar questions, however none seem to exemplify or resolve the exact issue that I am having, at least not that I was able to find.
NOTE 2: Since these scripts are going to be distributed and shared amongst several users, I would like to resolve this issue without having to make any manual changes to my PATH settings.
The contents of my main script (called mainScript.sh) in the original form (without any of my attempted changes) are as follows:
#!/bin/bash
. script2.sh
The full command I use from Windows command prompt is:
c:\path\to\mintty.exe -h always -e /cygdrive/C/Users/path/to/script/mainScript.sh
I receive this error message upon execution:
/cygdrive/C/Users/path/to/script/mainScript.sh: line 3: script2.sh: No such file or directory