From 1953a1461fee16e0fa4502156fb43e941920ca03 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 1 Jan 2022 18:08:15 -0800 Subject: [PATCH] doc: document BusyBox sed w bug --- doc/autoconf.texi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 17a6326e..04730dcc 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -20170,6 +20170,30 @@ s/.*/deleted/g :end @end example +@item @command{sed} (@samp{w}) +@c --------------------------- +@prindex @command{sed} (@samp{w}) + +When a script contains multiple commands to write lines to the same +output file, BusyBox @command{sed} mistakenly opens a separate output +stream for each command. This can cause one of the commands to ``win'' +and the others to ``lose'', in the sense that their output is discarded. +For example: + +@example +sed -n -e ' + /a/w xxx + /b/w xxx +' <