GNU bug report logs -
#19842
sed bug: using -e instead of a literal newline in s replacement fails
Previous Next
Full log
Message #11 received at 19842 <at> debbugs.gnu.org (full text, mbox):
On Tue, Feb 17, 2015 at 3:48 PM, Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
> Hi,
>
> I interprete following as multiple `-e' option does not merge fragments
> of two commands.
>
> # If any -e or -f options are specified, the script of editing commands
> # shall initially be empty.
>
> i.e. the command by first -e option is parsed without the completion,
> the buffer is initialized into empty before next -e option.
>
> Thanks,
> Norihiro
>
Hi Norihiro,
Thanks for replying. I respectfully disagree with your interpretation.
The -e and -f options talk about "the script of editing commands" as
the entire script/program that will run once sed starts reading input.
Both -e and -f add commands to "the end of the script of editing
commands." The line you quoted uses the exact same phrase:
1) -e script
Add the editing commands specified by the script option-argument to
the end of the script of editing commands.
2) -f script_file
Add the editing commands in the file script_file to the end of the
script of editing commands.
3) If any -e or -f options are specified, the script of editing
commands shall initially be empty.
I posit that "the script of editing commands" means the same thing in
all three places. Therefore (3) means that the script/program that sed
will run is empty before the first -e or -f.
Your interpretation would cause "the script of editing commands" to
mean something different in (3) than it means in (1) and (2).
Thank you,
Evan
This bug report was last modified 6 years and 249 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.