bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26879: end-of-line issue with cygwin 4.4-1 sed 4.4


From: Dick Dunbar
Subject: bug#26879: end-of-line issue with cygwin 4.4-1 sed 4.4
Date: Fri, 12 May 2017 23:39:14 -0700

Got it.  Thanks for the examples.  I guess I don't understand why my little
filter worked for so many years on so many platforms that I never gave it
a second thought ... or ever tried to over-think the problem.

I'll go back to MobaXterm environment and retry my code.
If it works ... I'll remove cygwin and never look back.

I'm having what you would call a "crisis of confidence".  :-)

- Cheers

On Fri, May 12, 2017 at 7:33 PM, Assaf Gordon <address@hidden> wrote:

>
> > On May 12, 2017, at 22:17, Assaf Gordon <address@hidden> wrote:
> >
> >  $ touch "a'b" 'c$d' 'e f' "$(printf 'g\nh')"
> >  $ find -type f -print0 \
> >         | tr -d '\r' \
> >         | sed -z -e "s/'/'\"'\"'/g" -e "s/^/'/" -e "s/\$/'/" \
> >         | tr '\0' '\n'
> >  './e f'
> >  './a'"'"'b'
> >  './g
> >  h'
> >  './c$d'
>
> Correcting myself:
> there is no need for the "tr -d '\r'" in the above example:
> since "find" uses "-print0" - it will NOT print LF or CRLF as line-endings,
> and so there's nothing to remove.
>
> -assaf
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]