[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#181808: marked as done (libc6: /etc/init.d/devpts incorrect use of grep)



Your message dated Thu, 20 Feb 2003 17:21:05 -0500
with message-id <20030220222105.GA531@nevyn.them.org>
and subject line Bug#181808: libc6: /etc/init.d/devpts incorrect use of grep
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 20 Feb 2003 20:38:35 +0000
>From jdg@polya.uklinux.net Thu Feb 20 14:38:34 2003
Return-path: <jdg@polya.uklinux.net>
Received: from mail2.uklinux.net [80.84.72.32] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18lxSj-0006Bv-00; Thu, 20 Feb 2003 14:38:33 -0600
Received: from polya (bts-0737.dialup.zetnet.co.uk [194.247.50.225])
	by mail2.uklinux.net (Postfix) with ESMTP id 66C62409FC1
	for <submit@bugs.debian.org>; Thu, 20 Feb 2003 20:38:29 +0000 (UTC)
Received: from jdg by polya with local (Exim 3.36 #1 (Debian))
	id 18lxSd-0000Hr-00; Thu, 20 Feb 2003 20:38:27 +0000
Date: Thu, 20 Feb 2003 20:38:27 +0000
From: Julian Gilbey <jdg@debian.org>
To: Debian bug reports <submit@bugs.debian.org>
Subject: libc6: /etc/init.d/devpts incorrect use of grep
Message-ID: <[🔎] 20030220203827.GA1019@polya>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.3i
Sender: Julian Gilbey <jdg@polya.uklinux.net>
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-4.0 required=4.0
	tests=HAS_PACKAGE,SIGNATURE_SHORT_SPARSE,SPAM_PHRASE_00_01,
	      USER_AGENT,USER_AGENT_MUTT
	version=2.44
X-Spam-Level: 

Package: libc6
Version: 2.3.1-11

The current /etc/init.d/devpts contains lines like:

devpts_avail=`grep -qci '[<[:space:]]devpts' /proc/filesystems || true`

But grep -qci never gives any output, it simply returns true (if a
line was found) or false (if not).  So this will always set
devpts_avail to empty, which isn't very useful.  Better ways of doing
this, while still always being true, would be:

devpts_avail=`grep -ci '[<[:space:]]devpts' /proc/filesystems || true`

(remove the -q option), or

devpts_avail=`grep -i '[<[:space:]]devpts' /proc/filesystems | wc -l`

(pipe to wc).  The latter has the possible advantage that if
/proc/filesystems is unavailable or something like that, set -e will
kill the script.

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

        Julian Gilbey, website: http://www.polya.uklinux.net/
   Debian GNU/Linux Developer, see: http://people.debian.org/~jdg/
     Visit http://www.thehungersite.com/ to help feed the hungry

---------------------------------------
Received: (at 181808-done) by bugs.debian.org; 20 Feb 2003 22:21:18 +0000
>From drow@false.org Thu Feb 20 16:21:17 2003
Return-path: <drow@false.org>
Received: from crack.them.org [65.125.64.184] (mail)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18lz47-000562-00; Thu, 20 Feb 2003 16:21:15 -0600
Received: from nevyn.them.org ([66.93.61.169] ident=mail)
	by crack.them.org with asmtp (Exim 3.12 #1 (Debian))
	id 18m0xA-0001y6-00; Thu, 20 Feb 2003 18:22:12 -0600
Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian))
	id 18lz3x-00008v-00; Thu, 20 Feb 2003 17:21:05 -0500
Date: Thu, 20 Feb 2003 17:21:05 -0500
From: Daniel Jacobowitz <dan@debian.org>
To: Julian Gilbey <jdg@debian.org>, 181808-done@bugs.debian.org
Subject: Re: Bug#181808: libc6: /etc/init.d/devpts incorrect use of grep
Message-ID: <20030220222105.GA531@nevyn.them.org>
References: <[🔎] 20030220203827.GA1019@polya>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[🔎] 20030220203827.GA1019@polya>
User-Agent: Mutt/1.5.1i
Delivered-To: 181808-done@bugs.debian.org
X-Spam-Status: No, hits=-3.3 required=4.0
	tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,
	      SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,USER_AGENT,
	      USER_AGENT_MUTT
	version=2.44
X-Spam-Level: 

On Thu, Feb 20, 2003 at 08:38:27PM +0000, Julian Gilbey wrote:
> Package: libc6
> Version: 2.3.1-11
> 
> The current /etc/init.d/devpts contains lines like:
> 
> devpts_avail=`grep -qci '[<[:space:]]devpts' /proc/filesystems || true`
> 
> But grep -qci never gives any output, it simply returns true (if a
> line was found) or false (if not).  So this will always set
> devpts_avail to empty, which isn't very useful.  Better ways of doing
> this, while still always being true, would be:
> 
> devpts_avail=`grep -ci '[<[:space:]]devpts' /proc/filesystems || true`
> 
> (remove the -q option), or
> 
> devpts_avail=`grep -i '[<[:space:]]devpts' /proc/filesystems | wc -l`
> 
> (pipe to wc).  The latter has the possible advantage that if
> /proc/filesystems is unavailable or something like that, set -e will
> kill the script.

Try -12 or -13.  -q used to do something different.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: