Subject: misc/3681: /etc/daily probably doesn't print result of uustat,
To: None <gnats-bugs@gnats.netbsd.org>
From: None <enami@ba2.so-net.or.jp>
List: netbsd-bugs
Date: 05/29/1997 21:59:34
>Number:         3681
>Category:       misc
>Synopsis:       /etc/daily probably doesn't print result of uustat, it uses awk to generate log filename for rdist but it's not necessary, and it is only script that uses x"$variable" != xNO while others use "$variable" != NO, etc.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 29 06:20:01 1997
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
>Release:        NetBSD-current 1997 May 27
>Environment:
System: NetBSD libretto.enami.ba2.so-net.or.jp 1.2E NetBSD 1.2E (LIBRETTO) #154: Thu May 22 10:15:29 JST 1997 enami@libretto.enami.ba2.so-net.or.jp:/a/kernel/compile/LIBRETTO i386


>Description:
	(1) /etc/daily probably doesn't print result of `uustat'.
	(2) /etc/daily uses `awk' to generate log filename for `rdist' but
	it's not necessary; `date' can produce it by itself.
	(3) /etc/daily is the only script that uses x"$variable" != xNO
	while others use "$variable" != NO.  Since `/bin/test' of NetBSD
	is clever enough to distingush operator and operand even if operand
	looks like operator, there is no need to add prefix `x', isn't it?
	(4) only purge_account section has semi-colon at the end of line.
	Is this necessary?

>How-To-Repeat:
	I noticed this by reading /etc/daily itself.

>Fix:
	Here is a diff except to fix x"$variable" != xNO and semi-colon.

Index: daily
===================================================================
RCS file: /a/cvsroot/NetBSD/src/etc/daily,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 daily
--- daily	1997/02/15 15:54:51	1.1.1.6
+++ daily	1997/05/27 10:29:47
@@ -157,6 +157,7 @@
 	if [ -s $TMP ]; then
 		echo ""
 		echo "uucp:"
+		cat $TMP
 	fi
 fi
 
@@ -183,7 +184,7 @@
 if [ x"$run_rdist" != xNO -a -f /etc/Distfile ]; then
 	echo "Running rdist:"
 	if [ -d /var/log/rdist ]; then
-		logf=`date | awk '{printf "%s.%s.%s", $6, $2, $3}'`
+		logf=`date +%Y.%b.%e`
 		rdist -f /etc/Distfile 2>&1 | tee /var/log/rdist/$logf
 	else
 		rdist -f /etc/Distfile 
>Audit-Trail:
>Unformatted: