Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jun 1996 12:39:13 -0700
From:      "Jin Guojun[ITG]" <jin@george.lbl.gov>
To:        bugs@freebsd.org, problem@bsdi.com
Subject:   sh bug
Message-ID:  <199606031939.MAA26616@george.lbl.gov>

next in thread | raw e-mail | index | archive | help
The sh in BSD does not take "-" as the argument in if statement if the
statement has more than one comparsions.
The following line are generating errors:

if [ "$1 = "-h" -o "$1" = "-help" ]; then
...
fi

if [ "$1 = "-h" -o 1 -le 2 ]; then
...
fi

if [ \( "$1 = "-h" \) -o \( "$1" = "-help" \) ];	then
...
fi

ERROR:
+ [ -h = -h -o -h = -help ]
[: syntax error: Undefined error: 0


but, it works in a single argument if statement:

if [ "$1 = "-h" ];	then
 ...
fi

Would some one please fix it?

	-Jin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606031939.MAA26616>