Re: [RFC PATCHv3 1/4] am: avoid re-directing stdin twice

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC PATCHv3 1/4] am: avoid re-directing stdin twice

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:27

Stephen Boyd [off-list ref] writes:
quoted
quoted
I see Stephen who wrote the original "Thunderbird save-as" is
already on the Cc list.  How about doing it this way instead?
It was so long ago I can't even remember writing that patch. But I
googled the thread from 4.5 years ago and I see that you suggested we
use tr because \r is not portable[1].
Hmph.  That's unfortunate that this may be one of those things that
even though it is in POSIX the real world prevents us from using it.

I wonder if things changed over the past four years, though.  Can
folks on OSX or BSD do a quick check?

Thanks.

Re: [RFC PATCHv3 1/4] am: avoid re-directing stdin twice

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 23:02:27

On 2014-09-06 09.34, Junio C Hamano wrote:
Stephen Boyd [off-list ref] writes:
quoted
quoted
quoted
I see Stephen who wrote the original "Thunderbird save-as" is
already on the Cc list.  How about doing it this way instead?
It was so long ago I can't even remember writing that patch. But I
googled the thread from 4.5 years ago and I see that you suggested we
use tr because \r is not portable[1].
Hmph.  That's unfortunate that this may be one of those things that
even though it is in POSIX the real world prevents us from using it.

I wonder if things changed over the past four years, though.  Can
folks on OSX or BSD do a quick check?
I may have missed the discussion, does this help?
"\r" can be used with tr, but not with sed:


tb@macosx:/tmp> cat ./xx.sh 
#!/bin/sh
which tr
printf "AB\rCD\n" | tr 'A\r\n\BCD' 'aRNbcd' | xxd
printf "E\rE" | tr -d '\r' | xxd
which sed
printf "AB\rCD\n" | sed -e  's/\r/R/g' | xxd
printf "E\rE" | sed -e 's/\r//g' | xxd

tb@macosx:/tmp> ./xx.sh 
/usr/bin/tr
0000000: 6162 5263 644e                           abRcdN
0000000: 4545                                     EE
/usr/bin/sed
0000000: 4142 0d43 440a                           AB.CD.
0000000: 450d 450a                                E.E.
tb@macosx:/tmp> 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help