Re: intended MBF: wrong redirections in maintainer scripts
- Date: Tue, 7 Aug 2018 16:23:13 +0200
- From: Adam Borowski <kilobyte@xxxxxxxxxx>
- Subject: Re: intended MBF: wrong redirections in maintainer scripts
On Tue, Aug 07, 2018 at 12:38:32PM +0200, Wouter Verhelst wrote:
> On Sat, Aug 04, 2018 at 01:15:57PM +0800, Ralf Treinen wrote:
> > as announced in our talk at debconf'18  we intend a MBF about wrong
> > redirections in maintainer scripts. In general these are of the form
> > foo 2>&1 1> /dev/null
> > Here it was probably intended to send both stderr and stdout to /dev/null.
> What makes you say that? ;-)
> It may be that the maintainer did indeed want stdout to be discarded,
> but stderr not; for instance because they wanted to parse the stderr
> (not saying this is the most likely case, but you might want to
> double-check that before filing the bugs)
Oy vey... I didn't notice this when Ralf's mail was posted (merely
checked whether I'm or QA are on the dd-list). But, indeed, this whole
MBF is wrong. Thanks Wouter!
The rarer case of silencing both stdout and stderr tends to be written:
foo >/dev/null 2>/dev/null
-- or at least I've been taught so, as this doesn't look like the common
foo 2>&1 /dev/null
which you somehow have a problem with. Don't you use this very construct
every a few days?
⢀⣴⠾⠻⢶⣦⠀ So a Hungarian gypsy mountainman, lumberjack by day job,
⣾⠁⢰⠒⠀⣿⡁ brigand by, uhm, hobby, invented a dish: goulash on potato
⢿⡄⠘⠷⠚⠋⠀ pancakes. Then the Polish couldn't decide which of his
⠈⠳⣄⠀⠀⠀⠀ adjectives to use for the dish's name.