public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Doug Henderson <djndnbvg@gmail.com>
To: cygwin <cygwin@cygwin.com>
Subject: Re: tee: 'standard output': Permission denied
Date: Tue, 29 Dec 2020 18:31:25 -0700	[thread overview]
Message-ID: <CAJ1FpuPec6H761z8-+NK+wqE+ZaJr8f8umyfjCMVVmikGCFquw@mail.gmail.com> (raw)
In-Reply-To: <1626660026.20201230005056@inbox.ru>

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

  parent reply	other threads:[~2020-12-30  1:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  2:04 Andry
2020-12-29 21:50 ` Andry
2020-12-30  1:29   ` Kevin Schnitzius
2020-12-30  2:22     ` Andry
2020-12-30 19:21       ` Brian Inglis
2020-12-31 16:33         ` Andry
2020-12-30  1:31   ` Doug Henderson [this message]
2020-12-30  1:45   ` Takashi Yano
2020-12-30  2:24     ` Andry
2020-12-30  4:02       ` Takashi Yano
2020-12-30  4:40         ` Takashi Yano
2020-12-30  4:54           ` Andry
2020-12-30  5:11           ` Andry
2020-12-30  4:49         ` Andry
2020-12-30  5:03           ` Takashi Yano
2020-12-30  5:18             ` Andry
2020-12-30  6:40             ` Takashi Yano
2020-12-30 10:13       ` Takashi Yano
2020-12-30 15:07         ` Andry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ1FpuPec6H761z8-+NK+wqE+ZaJr8f8umyfjCMVVmikGCFquw@mail.gmail.com \
    --to=djndnbvg@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).