Quote:>I am writing a small script at home for use at work, I have Linux at home
>Sun OS 4.1.3 at work. I am writing a bash/sh script which needs to compare
>two string variables. My "UNIX in a Nutshell" book hints to a syntax of []
>but I haven't figured it out. Can the following example be implemented in
>ws> testscript abcd
> if [ $arg < "abc" ]; then
> if [ $arg > "abcz" ]; then
The  construct is just another way of using the "test" function of the
shell. In fact, if you look in /bin you will find a file named "[" which is
linked to "test". From the man page on test;
s1=s2 True if strings s1 and s2 are identical.
s1!=s2 True if strings s1 and s2 are not identical.
s1 True if s1 is not the null string.
if [ "$arg"="abc"] ; then #means, if $arg is identical to abc do the next
if test "$arg"="abc"
is the same statement.
See the man page on test for more information.