zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: More tests
Date: 23 Dec 1999 06:55:07 +0900	[thread overview]
Message-ID: <rsq1z8e3akk.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Peter Stephenson's message of "Tue, 21 Dec 1999 22:35:40 +0000"

In article <E120XrM-00073o-00.1999-12-21-22-34-25@mail4.svr.pol.co.uk>,
  Peter Stephenson <pws@pwstephenson.fsnet.co.uk> 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


      parent reply	other threads:[~1999-12-22 21:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-21 22:35 Peter Stephenson
1999-12-22 10:47 ` Zefram
1999-12-22 21:55 ` Tanaka Akira [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rsq1z8e3akk.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).