Background: I am trying to write a [.bat] file so I can double click it and a bash script will get invoked. The bash script will start up a few window
I had a similar issue around tee redirection:
"%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:\=/%"""
This kind of code is required if you want to run a bash shell with login in a specific directory (cd
before call to login shell).
But in mine case it won't work, because of the error: tee: 'standard output': Permission denied
Update:
Found a fix here: https://sourceware.org/pipermail/cygwin/2020-December/247185.html
In Win7,
1) Start command prompt.
2) Run chcp 65001
3) Change the font of command prompt to raster font.
4) Run c:\cygwin\bin\printf "\xce\b1\n"
This causes the error:
/usr/bin/printf: write error
What weird is that if the font is other than raster font,
this error does not occur.
A raster font triggers the console write error (a permission denied
in case of piping) under 65001 code page specifically in the Windows 7.