docs/80650: Wrong sed arguments in command for CRLF->LF conversion in porters-handbook
Giorgos Keramidas
keramida at freebsd.org
Thu May 5 10:00:29 UTC 2005
The following reply was made to PR docs/80650; it has been noted by GNATS.
From: Giorgos Keramidas <keramida at freebsd.org>
To: Vasil Dimov <vd at datamax.bg>
Cc: bug-followup at freebsd.org
Subject: Re: docs/80650: Wrong sed arguments in command for CRLF->LF conversion in porters-handbook
Date: Thu, 5 May 2005 12:57:55 +0300
On 2005-05-05 12:26, Vasil Dimov <vd at datamax.bg> wrote:
> The command given in the "4.4 Patching" chapter of the
> porters-handbook as a way to convert CRLF line endings
> (dos format) to LF (unix) uses sed's -e argument when
> it is not needed (only one sed command) and misses -E
> argument when it is needed to interpret the regexp as
> an extended regular expression.
> --- en_US.ISO8859-1/books/porters-handbook/book.sgml.orig Thu May 5 12:18:55 2005
> +++ en_US.ISO8859-1/books/porters-handbook/book.sgml Thu May 5 12:19:01 2005
> @@ -694,7 +694,7 @@
>
> post-extract:
> @${FIND} -E ${WRKDIR} -type f -iregex ".*\.(c|cpp|h|txt)" -print0 | \
> - ${XARGS} -0 ${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//'</programlisting>
> + ${XARGS} -0 ${REINPLACE_CMD} -E 's/[[:cntrl:]]*$$//'</programlisting>
This is not an extended RE and, in my opinion, it's better to be safe
than sorry. We are using a long and somewhat complex command as an
example, which some Unix newcomers may find instructive. In this case,
I vote for clarity instead of the dubious brevity we get by deleting
just a short single-letter option :-)
More information about the freebsd-doc
mailing list