Date: Wed, 02 Jul 2014 18:18:59 -0500 From: Pedro Giffuni <pfg@freebsd.org> To: Bryan Drewery <bdrewery@FreeBSD.org>, Jilles Tjoelker <jilles@stack.nl> Cc: freebsd-standards@FreeBSD.org Subject: Re: sed -i Message-ID: <53B49363.9020308@freebsd.org> In-Reply-To: <53B485D3.1080602@FreeBSD.org> References: <53556919.4010305@freebsd.org> <53ADD32C.5040503@FreeBSD.org> <20545470-A847-4835-A42B-382E5CC363ED@freebsd.org> <53B477E6.10103@FreeBSD.org> <20140702221739.GB61834@stack.nl> <53B485D3.1080602@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
On 07/02/14 17:21, Bryan Drewery wrote: > On 7/2/2014 5:17 PM, Jilles Tjoelker wrote: >> On Wed, Jul 02, 2014 at 04:21:42PM -0500, Bryan Drewery wrote: >>> On 6/27/2014 4:15 PM, Pedro Giffuni wrote: >>>> While here, there is also the sed(1) syntax issue: >>>> https://www.illumos.org/issues/586 >>>> Adopting both changes would probably reduce to a minimum the use of >>>> GNU sed in the ports tree, but such changes are likely to be >>>> controversial(?) and I don’t feel like wearing asbestos underwear at >>>> this time .. at least not for sed ;). >>> IMHO yes that is a good thing to bring over as it helps with people >>> coming from other platforms and improves portability with scripts. I >>> started on Linux and kept wondering why I had FILEe files all over my >>> system until I realized -i '' was required on FreeBSD. >> What are your ideas about the breakage this will cause? sed -i was >> proposed in the Austin Group, but standardization broke down on this >> issue. >> >> Even a simple grep for 'sed -i' finds a few dozen uses in FreeBSD base >> that would be broken, for example: >> > Breaking -i '' is not acceptable. > > I can't find the patch in question, but from the linked issue I found: > > https://gist.github.com/jclulow/1394562 > > It seems to address the backwards-compat concern. FWIW, that patch is not in illumos [1]. >> etc/Makefile: sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab >> >> On the other hand, >> >> usr.sbin/pc-sysinstall/backend/functions-cleanup.sh: sed -i -e "s|my.domain|${HOSTNAME} ${HOSTNAME}|g" ${FSMNT}/etc/hosts >> >> appears to attempt to use the GNU form. >> >> Also, where a backup suffix is deliberately given, it is always attached >> to -i. Therefore, it would work for the scripts in FreeBSD base to use >> the GNU behaviour except that an empty argument after an argumentless -i >> option counts as an argument to that -i option anyway. >> > Undoubtedly backwards compatibility is a concern: we should add a test for this (if there isn't already). Pedro. [1] Check history on: http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/sed/help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53B49363.9020308>
