Package: sed
Version: 4.2.1-9
Severity: normal
The following script inserts the contents of a file after the first
occurrence of a regex:
~$ { seq 1 3 ; seq 1 3 ; } | sed -n -e 'p ; /2/!b ; r /etc/hostname' -e ':loop
; n ; p ; b loop'
1
2
feather
3
1
2
3
If I combine the two -e arguments using a semicolon, the script stops working:
~$ { seq 1 3 ; seq 1 3 ; } | sed -n -e 'p ; /2/!b ; r /etc/hostname ; :loop ; n
; p ; b loop'
1
2
3
1
2
3
If I combine the two -e arguments using a newline, the script works:
~$ { seq 1 3 ; seq 1 3 ; } | sed -n -e 'p ; /2/!b ; r /etc/hostname
:loop ; n ; p ; b loop'
1
2
feather
3
1
2
3
Possibly the 'r' command doesn't know when to stop reading the filename?
- Josh Triplett
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages sed depends on:
ii dpkg 1.16.0 Debian package management system
ii install-info 4.13a.dfsg.1-6 Manage installed documentation in
ii libc6 2.11.2-13 Embedded GNU C Library: Shared lib
ii libselinux1 2.0.98-1 SELinux runtime shared libraries
sed recommends no packages.
sed suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]