From owner-freebsd-hackers Fri Jun 30 7:43:52 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rapidnet.com (rapidnet.com [205.164.216.1]) by hub.freebsd.org (Postfix) with ESMTP id 6662C37B9E2 for ; Fri, 30 Jun 2000 07:43:45 -0700 (PDT) (envelope-from nick@rapidnet.com) Received: from localhost (nick@localhost) by rapidnet.com (8.9.3/8.9.3) with ESMTP id IAA07616; Fri, 30 Jun 2000 08:43:24 -0600 (MDT) Date: Fri, 30 Jun 2000 08:43:24 -0600 (MDT) From: Nick Rogness To: Fotis Georgatos Cc: Konstantin Chuguev , freebsd-hackers@freebsd.org Subject: Re: Periodic scripts [Was: Re: /etc/security -> /etc/periodic/security ?] In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 30 Jun 2000, Fotis Georgatos wrote: > Why bother with complex shell scripts when you can have most > needed functionality in a single C program? > I've found myself replacing 10-20 lines of shell code with a single line. WHAT? Are you crazy? I've found just the opposite. What shell scripting are you using? Example to find # of duplicate usernames in your password file: #!/usr/local/bin/ksh VAR1=`awk -F: '{print $1}' /etc/passwd|grep -cx $1` print "Number of occurences of $1 in /etc/passwd: $VAR1" Let me see you replicate that in C in less than 2 lines... Nick Rogness - Speak softly and carry a Gigabit switch. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message