[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I make a portable test??
From: |
Eric Siegerman |
Subject: |
Re: How do I make a portable test?? |
Date: |
Fri, 14 Feb 2003 00:09:13 -0500 |
User-agent: |
Mutt/1.2.5i |
On Fri, Feb 14, 2003 at 02:11:37AM +0000, Dr. David Kirkby wrote:
> "test: ==: unexpected operator" on a Sun running NetBSD 1.6
"==" is indeed unexpected :-) Bourne shell doesn't support it; I
don't believe ksh does either. It looks like a bash extension,
in which shell it does pattern matching. (Even the standalone
/usr/bin/test on my Mandrake 7.2 box doesn't support "=="; only
bash's built-in "test" does.)
Use "=" or "!=" for string comparison; for numeric comparison the
operators are:
-eq -ne -gt -ge -lt -le
> The section below between the two rows of stars works fine on a Sun
> workstation running Solaris 9 (tcsh shell), a Sun workstation running
> Debian Linux (bash shell), a PC running Redhat 7.3 Linux (tcsh shell),
I bet the Solaris box has bash installed -- and as /bin/sh too!
Linux systems typically have bash as /bin/sh, so the script's
success there is unsurprising.
By "(tcsh shell)" I presume you mean it's your login shell.
That's irrelevent; what matters is the one named in the script's
"#!" line.
--
| | /\
|-_|/ > Eric Siegerman, Toronto, Ont. address@hidden
| | /
A distributed system is one on which I cannot get any work done,
because a machine I have never heard of has crashed.
- Leslie Lamport
- How do I make a portable test??, Dr. David Kirkby, 2003/02/13
- Re: How do I make a portable test??, John Burger, 2003/02/13
- Re: How do I make a portable test??,
Eric Siegerman <=
- Re: How do I make a portable test??, Dr. David Kirkby, 2003/02/14
- Re: How do I make a portable test??, Eric Siegerman, 2003/02/14
- Re: How do I make a portable test??, Andreas Schwab, 2003/02/14
- Re: How do I make a portable test??, Thomas E. Dickey, 2003/02/14
- Re: How do I make a portable test??, Eric Siegerman, 2003/02/14
- Re: How do I make a portable test??, Bruce Korb, 2003/02/15
- Re: How do I make a portable test??, Eric Siegerman, 2003/02/17