Am 10.06.2024 um 13:12 schrieb Holger Klene via Cygwin:
Hi Cygwin, On reading a magic value back from a bash variable, the involved command (wc, grep, cat, ...) hangs indefinitely and has to be stopped by Ctrl+C Editing it's content by deleting lines, the "magic" goes away. Also as demonstrated, other text-files (even twice the size) work fine. See this bash session: --- holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ wc -l magic.txt text.log 2074 magic.txt 4214 text.log 6288 insgesamt holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ md5sum magic.txt text.log 8ee7af38464d80a716d18d44c0a22f22 *magic.txt 0211535797c8d2e6b363f7dde147949f *text.log holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ cat magic.txt | wc -l 2074 holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ cat text.log | wc -l 4214 holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ declare ctrl=$(cat magic.txt) && printf '%s\n' "$ctrl" | wc -l 2074 holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ declare ctrl=$(cat text.log) && printf '%s\n' "$ctrl" | wc -l 4214 holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ declare ctrl=$(cat text.log) && wc -l <<< "$ctrl" 4214 holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ declare ctrl=$(cat magic.txt) && wc -l <<< "$ctrl" <CTRL+C> holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ declare ctrl=$(cat magic.txt) && grep hallo <<< "$ctrl" <CTRL+C> holgerk@BX-NB-015 /cygdrive/c/Users/holgerk $ declare ctrl=$(cat magic.txt) && cat <<< "$ctrl" <CTRL+C>
Works for me.
--- This is: GNU bash, Version 5.2.21(1)-release (x86_64-pc-cygwin) Was also reproduced in git-bash 5.2.26(1)-release (also cygwin) but not in WSL-bash 5.1.16 (independent of cygwin) Thanks Holger PS: I reported this to git first: Gesendet: Montag, 10. Juni 2024 um 11:58 Uhr Von: "Johannes Schindelin" <notificati...@github.com> An: "git-for-windows/git" <g...@noreply.github.com> Cc: "Holger Klene" <h.kl...@gmx.de>, "Mention" <ment...@noreply.github.com> Betreff: Re: [git-for-windows/git] bash redirect "magic" variable content to input of command hangs (Issue #5001) I just verified that this is happening in regular https://cygwin.com/ which, in this ticket's context is an upstream project of Git for Windows, as we use a slightly modified version of the Cygwin runtime as POSIX emulation layer that allows Bash to work. @hklene[https://github.com/hklene] would you mind reporting it there[https://cygwin.com/problems.html]? — Reply to this email directly, view it on GitHub[https://github.com/git-for-windows/git/issues/5001#issuecomment-2157897799], or unsubscribe.
-- 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