From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 2E2973858022 for ; Wed, 30 Dec 2020 01:31:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2E2973858022 Received: by mail-qk1-x734.google.com with SMTP id c7so12942894qke.1 for ; Tue, 29 Dec 2020 17:31:37 -0800 (PST) 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.20201227050421@inbox.ru> <1626660026.20201230005056@inbox.ru> In-Reply-To: <1626660026.20201230005056@inbox.ru> From: Doug Henderson Date: Tue, 29 Dec 2020 18:31:25 -0700 Message-ID: Subject: Re: tee: 'standard output': Permission denied To: cygwin 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 01:31:40 -0000 On Tue, 29 Dec 2020 at 14:48, Andry via Cygwin 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