Subject: bin/13762: should not /etc/rc.d/ avoid using egrep ?
To: None <>
From: Stoned Elipot <>
List: netbsd-bugs
Date: 08/21/2001 01:23:04
>Number:         13762
>Category:       bin
>Synopsis:       /etc/rc.d/ uses egrep when it may not be available
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 20 16:20:00 PDT 2001
>Originator:     Stoned Elipot
>Release:        NetBSD 1.5.1
Pandore's Box <>
System: NetBSD runabout 1.5.1 NetBSD 1.5.1 (RUNABOUT) #0: Sun Aug 19 02:24:21 CEST 2001     seb@runabout:/site/src/sys/arch/i386/compile/RUNABOUT i386

/etc/rc.d/ uses egrep which is of course /usr/bin/egrep. If one
does not put a static egrep in say /bin or add /usr to 
$critical_filesystems_beforenet's variable conflist is
not initialized properly, or am I wrong?...
Run newbtconf init, reboot and watch the messages before prompts
for the configuration to use (make sure you don't have a egrep in /bin
or /sbin or that /usr is not listed in $critical_filesystems_beforenet :)
the following fix aims to get ride of egrep usage in

--- /etc/rc.d.orig/	Tue Aug 21 00:19:37 2001
+++ /etc/rc.d/	Tue Aug 21 00:21:10 2001
@@ -21,9 +21,12 @@
-	conflist=`cd /etc; ls -1d etc.* 2>&1 | egrep -v "current|default"`
+	conflist=`cd /etc; ls -1d etc.* 2>&1`
 	for i in $conflist; do
+		case "$name" in
+			default|current) continue ;;
+		esac
 		if [ "$name" = "$default" ]; then
 			echo -n "${spc}[${name}]"