Subject: Re: test(1) questions
To: None <tech-userlevel@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-userlevel
Date: 11/24/2003 02:38:56
In article <20031123234718.GA617@bjan.net>,
Bruce J.A. Nourish <bjan+tech-userlevel@bjan.net> wrote:
>Hey everyone,
>
>Should sh(1)'s builtin grok ==? ksh's builtin and test(1) do.
>
>I've written an sh replacement for src/bin/test/TEST.csh. It yields
>the same results as the original on my machine.
This is broken. You are executing this with /bin/sh. csh does not have
functions.
christos
>
>Should I send-pr on any of this?
>
>--- TEST.csh 1995-03-21 00:03:59.000000000 -0700
>+++ TEST.sh 2003-11-23 16:39:47.000000000 -0700
>@@ -1,8 +1,13 @@
>-# $NetBSD: TEST.csh,v 1.2 1995/03/21 07:03:59 cgd Exp $
>+# $NetBSD: TEST.csh,v 1.2 1995/03/21 07:03:59 cgd Exp $
> # @(#)TEST.csh 5.2 (Berkeley) 4/30/93
>
> #alias t '/usr/src/bin/test/obj/test \!*; echo $status'
>-alias t '/bin/test \!*; echo $status'
>+#alias t '/bin/test \!*; echo $status'
>+
>+t () {
>+ /bin/test "$@"
>+ echo $?
>+}
>
> echo 't -b /dev/ttyp2'
> t -b /dev/ttyp2
>--
>Bruce J.A. Nourish <bjan+public@bjan.net> http://bjan.net