On Tue, 29 Dec 2020 at 14:48, Andry via Cygwin <cygwin@cygwin.com> wrote:

>
>   "%CYGWIN_ROOT%\bin\bash.exe" -c "{ cd ""%PWD:\=/%""; CHERE_INVOKING=.
> ""%CYGWIN_ROOT:\=/%/bin/bash.exe"" -l -i; } 2>&1 |
> ""%CYGWIN_ROOT:\=/%/bin/tee.exe"" -a ""%PROJECT_LOG_FILE:\=/%"""
>   ```
>

In most situations like this, I  create a bash script containing everything
I want to do within bash. Trying to get all the quoting right is a pain in
the brain.

The key lines in my .bat files (with CRLF endings) are:

set D=folder  *the directory containing script
set SCRIPT=script.sh   *the name if the bash script file (with LF endings)
set BASH=C:\cygwin64\bin\bash.exe
%BASH% --noprofile -o errexit -o nounset -c %D%/%SCRIPT%

Note the forward slash between script directory and script file, very
important!
Also note there is no quoting required - a big win.

First command in the bash script is usually an "export PATH=..." command.

Of course, if there is an actual permissions error, this will not fix it,
but it will allow you to more easily diagnose the problem.

HTH
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to