From owner-freebsd-hackers Fri Jun 30 8: 4: 7 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id 8C38037BDE7 for ; Fri, 30 Jun 2000 08:04:03 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.3) with ESMTP id RAA02907; Fri, 30 Jun 2000 17:03:47 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Nick Rogness Cc: Fotis Georgatos , Konstantin Chuguev , freebsd-hackers@FreeBSD.ORG Subject: Re: Periodic scripts [Was: Re: /etc/security -> /etc/periodic/security ?] In-reply-to: Your message of "Fri, 30 Jun 2000 08:43:24 MDT." Date: Fri, 30 Jun 2000 17:03:47 +0200 Message-ID: <2905.962377427@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message , Nick Rognes s writes: >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, I can do it in one line, but it will suck style wise because I cannot use #includes. Can we stop this pissing contest now before anybody starts flouting APL single-liners ? Thanks. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD coreteam member | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message