rc-scripts/trunk/rc.d: rc rc.modules rc.shutdown rc.sysinit

Jan Rekorajski baggins at sith.mimuw.edu.pl
Tue Oct 25 17:49:54 CEST 2005


On Tue, 25 Oct 2005, Elan Ruusamäe wrote:

> On Tuesday 25 October 2005 17:17, baggins wrote:
> > Author: baggins
> > Date: Tue Oct 25 16:17:26 2005
> > New Revision: 6479
> >
> > Modified:
> >    rc-scripts/trunk/rc.d/rc
> >    rc-scripts/trunk/rc.d/rc.modules
> >    rc-scripts/trunk/rc.d/rc.shutdown
> >    rc-scripts/trunk/rc.d/rc.sysinit
> > Log:
> > - grep: all your stderr are belong to /dev/null
> [...]
> 
> > Modified: rc-scripts/trunk/rc.d/rc
> > ===========================================================================
> >=== --- rc-scripts/trunk/rc.d/rc	(original)
> > +++ rc-scripts/trunk/rc.d/rc	Tue Oct 25 16:17:26 2005
> > @@ -92,7 +92,7 @@
> >
> >  # See if we want to be in user confirmation mode
> >  if [ "$previous" = "N" ]; then
> > -	if grep -qi confirm /proc/cmdline >/dev/null \
> > +	if grep -qi confirm /proc/cmdline >/dev/null 2>/dev/null \
> 
> grep -q implies already silence, what situation this solves?
> perhaps just add -s option?

       -s, --no-messages
              Suppress error messages about nonexistent or  unreadable files.
              Portability note: unlike GNU grep, traditional grep did not con-
              form to POSIX.2, because traditional grep lacked a -q option and
              its  -s option behaved like GNU grep's -q option.  Shell scripts
              intended to be portable to traditional grep should avoid both -q
              and -s and should redirect output to /dev/null instead.

I can change all redirections to /dev/null to -(q)s if we don't care.

Janek
-- 
Jan Rękorajski            |  ALL SUSPECTS ARE GUILTY. PERIOD!
baggins<at>mimuw.edu.pl   |  OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY?
BOFH, MANIAC              |                   -- TROOPS by Kevin Rubio



More information about the pld-devel-en mailing list