delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/12/29/20:32:21

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BD373858022
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1609291901;
bh=eWfkORNMaUZg3ZUUgtURrNYgFymLIyH/KgYaT+Yn6fs=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=XZQ6t8L8nTGlbIOQcetKUrwjQIWqo1wlJghSViDkeCUj3wqlrovyJ+wTlDJsovalH
Q2PsQ2HTVH/tUQOId6DqLXGVaDHHxj84qNfcLFcgvBUV991bqu/xBpXd/LMCbEfgco
Y8Q3gW5a+nsczQS8UTS/ZIWZcr7yJs2WgwgHXnLM=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2E2973858022
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=RVVnx4xcr2YBc28Q6jYl6crkBfmkmxX3m9ImYDxqkaI=;
b=QogIaidk18SdsGswf64V+UMaH2pob35IJlbTnbM7KxEQUPpGHscoC/6kh41VvkLylO
I5HTZuqMRGxQGIVSH44qmmY74xxnd9rj0klEK70RDXeof+HMm75XtWoEXbS/0d/DFlo+
3dZqOyXrwtI39kU0PHfc1U/ufd7etbUW0/h8GkCSpLuOarfYnVbrMY9oApqnjHHfab+g
4I1hdiTN8BmxvUqZ48B3cfXfzDYrB5MvJGi3z9UBViU0qzcX7Vqo6CNfv4Vg4lFV0KMr
Pp63T9NdkqCK+Qqsm36IHqMX7VrBttWKOFQsGcWqp9b3ASYa5UBl0XG4hjKkPfOfobc0
Rc/Q==
X-Gm-Message-State: AOAM5311djU6UnPjpj8JOkH2q1S/CjJCVys5KSGxIcXZxO1cw5rDn6Bl
nuwadMJ7havTuM+1Zl5j9G/cKF9GubuI+JH3t7fiIo2xGiAP0w==
X-Google-Smtp-Source: ABdhPJw0XTChgVQkziwFnvCB0Ka1cMrDoG4n5QAhUnixf2MqBKMzH6Qp2Qc85WBTpCEZpa5G4vJPHidcuPOhN6J20ZU=
X-Received: by 2002:a37:a917:: with SMTP id s23mr50826566qke.214.1609291896512;
Tue, 29 Dec 2020 17:31:36 -0800 (PST)
MIME-Version: 1.0
References: <1939012153 DOT 20201227050421 AT inbox DOT ru>
<1626660026 DOT 20201230005056 AT inbox DOT ru>
In-Reply-To: <1626660026.20201230005056@inbox.ru>
Date: Tue, 29 Dec 2020 18:31:25 -0700
Message-ID: <CAJ1FpuPec6H761z8-+NK+wqE+ZaJr8f8umyfjCMVVmikGCFquw@mail.gmail.com>
Subject: Re: tee: 'standard output': Permission denied
To: cygwin <cygwin AT cygwin DOT com>
X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,
HK_RANDOM_ENVFROM, HK_RANDOM_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP,
WEIRD_QUOTING autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Doug Henderson via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Doug Henderson <djndnbvg AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On Tue, 29 Dec 2020 at 14:48, Andry via Cygwin <cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019