Re: sed -i
- From: Diomidis Spinellis <dds@xxxxxxx>
- Date: Thu, 29 Mar 2007 11:19:44 +0300
Yar Tikhiy wrote:
Hi,
Recently noticed that our sed(1) differs from its GNU analog in
that in -i mode it considers all files as a single sequence of lines
while the latter treats each file independently. The in-line mode
isn't in POSIX, so it isn't really clear which way is correct.
Here is a couple of practical consequences:
- our sed won't act on a numeric range of lines in each file,
as in: sed -i '' 2,5d *, which may be counter-intuitive.
- our sed's line ranges can span file boundaries in -i mode.
If the second feature isn't important, I think we should use
a separate line space for each file edited in-line, which is
usually desired.
Comments?
P.S. Attached are a test script and outputs from it for our
sed and GNU sed as found in a Linux I have access to.
I believe the GNU interpretation of lines in -i makes sense.
Diomidis - dds@
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: sed -i
- From: Yar Tikhiy
- Re: sed -i
- References:
- sed -i
- From: Yar Tikhiy
- sed -i
- Prev by Date: Re: sendto() giving EPERM outside a jail
- Next by Date: NVIDIA FreeBSD kernel feature requests
- Previous by thread: Re: sed -i
- Next by thread: Re: sed -i
- Index(es):