From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17862 invoked from network); 22 Dec 1999 21:55:21 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Dec 1999 21:55:21 -0000 Received: (qmail 9726 invoked by alias); 22 Dec 1999 21:55:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9137 Received: (qmail 9719 invoked from network); 22 Dec 1999 21:55:10 -0000 To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: More tests References: MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 23 Dec 1999 06:55:07 +0900 In-Reply-To: Peter Stephenson's message of "Tue, 21 Dec 1999 22:35:40 +0000" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article , Peter Stephenson writes: > Here are some more tests for basic shell stuff. This is some shell scripting portability fixes. 1. modish is changed to a directory. On Solaris 7 and 4.4BSD, sticky bit for non-directories can be set only by root. If an usual user attempt to do it, Solaris 7 simply ignores the bit and 4.4BSD --- I tested on FreeBSD 2.2.8, NetBSD 1.4.1 and BSD/OS 3.0 --- causes EFTYPE. 2. The format of `df' is different on Solaris 7. Z:akr@is27e1u11% df / / (/dev/dsk/c0t0d0s0 ): 1221764 blocks 316009 files Z:akr@is27e1u11% 3. mknod cannot be used for making a pipe on 4.4BSD. Z:akr@ape% mknod pipe p usage: mknod name [b | c] major minor zsh: exit 1 mknod pipe p Z:akr@ape% mkfifo should be used instead. mknod on NetBSD 1.4.1 supports above usage, though. Index: Test/07cond.ztst =================================================================== RCS file: /projects/zsh/zsh/Test/07cond.ztst,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 07cond.ztst --- Test/07cond.ztst 1999/12/21 23:12:01 1.1.1.1 +++ Test/07cond.ztst 1999/12/22 21:29:58 @@ -13,7 +13,7 @@ touch zerolength print 'Garbuglio' >nonzerolength - touch modish + mkdir modish chmod g+s modish chmod u+s modish chmod +t modish @@ -26,7 +26,11 @@ 0:-a cond # Find a block special file system. This is a little tricky. - block=$(df / | tail -1 | awk '{ print $1 }') && + block=$(df / | awk ' + $NF == "/" {print $1} + $1 == "/" && substr($2,0,1) == "(" { + if((l = index($2,")") - 2) < 0) l = length($2) - 1; + print substr($2,2,l)}') && [[ -b $block && ! -b zerolength ]] 0:-b cond @@ -61,7 +65,11 @@ [[ -o rcs && ! -o norcs && -o noerrexit && ! -o errexit ]] 0:-o cond - mknod pipe p + if whence mkfifo >/dev/null; then + mkfifo pipe + else + mknod pipe p + fi [[ -p pipe && ! -p zerolength ]] 0:-p cond -- Tanaka Akira