Subject: Re: [ANNOUNCEMENT] Updated: cygutils 1.4.16-7
From: Brian Inglis <[email-masked]>
To: [email-masked]
Date: Mon, 27 Sep 2021 00:13:34 -0600
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>

On 2021-09-26 18:46, Westcoast Human via Cygwin wrote:
> I'm just going to jump in here and report what I think is an issue I
> am having with 'putclip.'
> 
> For years I've been using a Windows shortcut to execute a simple
> filter function. It has recently stopped working. This is the 'target'
> entry for the shortcut:
> C:\Windows\System32\cmd.exe /c "c:\cygwin64\bin\getclip.exe |
> c:\cygwin64\bin\tr.exe -s '\012\015' ' ' |
> c:\cygwin64\bin\putclip.exe"
> 
> This now wedges and is not interruptible with Ctrl-C, but closing the
> CMD window kills everything. Task Manager shows that putclip is
> apparently stuck in a loop waiting for something to happen as the
> counts in "I/O Other" and "I/O Other bytes" keep increasing at a
> regular rate (should a timeout error be incorporated, perhaps?)

Try:

c:\cygwin64\bin\dash -c '/bin/getclip | /bin/tr -s "\r\n" " " | 
/bin/putclip'

e.g.

$ mkshortcut -D -n clip-strip /bin/dash -a "-c '/bin/getclip | /bin/tr 
-s \"\r\n\" \" \" | /bin/putclip'"

works and doesn't hang with latest Cygwin.

Note: tr has accepted C escapes for decades (Turbo C days), and use of 
"\012\015" == "\n\r" is anachronistic, rarely encountered compared to 
older systems' and network protocols' text line ending "\r\n", where 
both may be repeated, or only the "\n" for skipping lines.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

-- 
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