From owner-freebsd-hackers Tue Jun 12 2:47:11 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from cyclone.tornadogroup.com (cyclone.tornadogroup.com [212.172.155.83]) by hub.freebsd.org (Postfix) with ESMTP id DF2A237B401 for ; Tue, 12 Jun 2001 02:47:06 -0700 (PDT) (envelope-from matthew.seaman@tornadogroup.com) Received: from claudette.e1.tornadogroup.com (root@claudette.e1.tornadogroup.com [192.168.0.77]) by cyclone.tornadogroup.com (8.10.0.Beta10/8.10.0.Beta10) with ESMTP id f5C9l5101447; Tue, 12 Jun 2001 10:47:05 +0100 (BST) Received: from tornadogroup.com (matthew@localhost [127.0.0.1]) by claudette.e1.tornadogroup.com (8.11.3/8.11.3) with ESMTP id f5C9l5o18987; Tue, 12 Jun 2001 10:47:06 +0100 (BST) (envelope-from matthew.seaman@tornadogroup.com) Message-ID: <3B25E519.ED3BE981@tornadogroup.com> Date: Tue, 12 Jun 2001 10:47:05 +0100 From: Matthew Seaman X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.3-STABLE i386) X-Accept-Language: en-GB, en MIME-Version: 1.0 To: Valentin Nechayev Cc: Cyrille Lefevre , Matthew Seaman , freebsd-hackers@FreeBSD.ORG Subject: Re: Perl module for periodic scripts References: <20010611102830.A26191@plasm.demon.co.uk> <20010612105318.B923@iv.nn.kiev.ua> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Valentin Nechayev wrote: > > Tue, Jun 12, 2001 at 02:57:46, clefevre-lists (Cyrille Lefevre) wrote about "Re: Perl module for periodic scripts": > > > FYI, the date stuff can be written in pure shell. don't know yet > > about the uniq -i but should be possible w/o perl. > > tr '[A-Z]' '[a-z]' | uniq > (does this uniquing requires to preserve case of at least one variant? > I suppose no) Hmmm... claudette:/tmp:% cat /tmp/foo aaa aaa aaa AAB aab aab AAB AAC aac AAC aac aac aac aac aad AAD AAD aad aad claudette:/tmp:% cat /tmp/foo | sort -f | uniq -ic 3 aaa 4 AAB 7 AAC 5 AAD claudette:/tmp:% cat /tmp/foo | tr '[A-Z]' '[a-z]' | sort | uniq -c 3 aaa 4 aab 7 aac 5 aad claudette:/tmp:% cat /tmp/foo | perl -ne '$s{lc $_}++; END { for (sort keys %s) { printf "%4d $_", $s{$_}; }}' 3 aaa 4 aab 7 aac 5 aad It's not quite the same, but probably good enough. > > see the following url on a portable (awk and ksh) replacement for > > date -v-1d : > > Then the program will contain perl, ksh and awk code? There are too many > languages used, aren't there? Also realize please that base system does not > contain ksh. Monolithic perl code, without awk & ksh, will be better because > perl is in base system already... Quite so. The current admixture of sh and perl in 470.status-named seems unaesthetic to me. On the other hand, FreeBSD /bin/sh is a lot more like Solaris /bin/ksh than it is like Solaris /bin/sh. Cyrille's ksh code should port fairly readily to FreeBSD /bin/sh. Matthew -- Matthew Seaman Tel: 01628 498661 Certe, Toto, sentio nos in Kansate non iam adesse. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message