[Bug 6884] the sed applet behaves erraticaly when script from file (option -f)

bugzilla at busybox.net bugzilla at busybox.net
Fri Feb 21 18:50:06 UTC 2014


--- Comment #2 from clu <clu at free.fr> 2014-02-21 18:50:05 UTC ---
  Thank you for taking care of my problem.

> (You need to stop escaping \" in the file version. IOW: \"\1\"  should be  "\1" there).
  My bad, i didn't notice... you totally right

> For me the script doesn't work as if line 3 is missing. The output is different from that too.
  That is precisely my point but ...
> I guess you are inserting \n chars to break lines and expect sed to detect those as new lines to operate one. This doesn't work.
  I understand here that, the 3 operations are realized on the same original
file while for the piped version last two operations
  are made on the "piped results" of the previous ones...
  thus even :
  sed -r -e "/sens=achat/! d; s/^[^<]*<//g; s/<tr /\n&/g" 
  is different from :
  sed -r -e "/sens=achat/! d" | sed -r -e "s/^[^<]*<//g; s/<tr /\n&/g"
  because in the first case the substitutions would also be done on the (later)
deleted lines
  whereas in the second case they would only be applied to the remaining lines,
after deletion.

  Am i understanding right?
  If so, that would explain to me why the commands can't be gathered in a
single sed script file.

  Again, many thank for your help.

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list