Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2005 10:00:26 GMT
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        freebsd-doc@FreeBSD.org
Subject:   Re: docs/80650: Wrong sed arguments in command for CRLF->LF conversion in porters-handbook
Message-ID:  <200505051000.j45A0Qe7084364@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/80650; it has been noted by GNATS.

From: Giorgos Keramidas <keramida@freebsd.org>
To: Vasil Dimov <vd@datamax.bg>
Cc: bug-followup@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@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 :-)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505051000.j45A0Qe7084364>