tee: 'standard output': Permission denied

Andry andry@inbox.ru
Tue Dec 29 21:50:56 GMT 2020


Hello Cygwin,

  >I am trying to change directory before run a bash shell with login:

  I've minimized to a minimal example to repro the issue:

  *run_cygwin_bash.bat*:

  ```
  @echo off

  set CYGWIN_ROOT=...
  set PWD=...
  set PROJECT_LOG_FILE=...

  chcp.com 65001 >nul


  "%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:\=/%"""
  ```

  To execute:

  ```
  c:\> start "" cmd.exe /C run_cygwin_bash.bat

  ```

  To stall:

  ```
  $ 123
  c:/cygwin/bin/tee: 'standard output': Permission denied
  ```

  It repro only if:

  `chcp.com 65001` used together with `start "" cmd.exe ...`



More information about the Cygwin mailing list