bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

if statement


From: Nevin Swan
Subject: if statement
Date: Wed, 7 Nov 2001 14:52:34 +1100

Hi,

I have a if statement that looks somthing like this...

for opt in $options ; do
        if [ $opt = \"DNS\" ] ; then            
                DNS=TRUE
        fi
done

obviously more to it than that... but $options contains seperate "options"
put there by an earlier piece of the script, the options are in the following
format...

"opt1" "opt2" "opt3" etc...

this is INCLUDING the ""

Now, the above "if" statement does work (as in it matches and sets the
variable DNS to TRUE) but before setting the variable it gives an error of...

./testscript: [: too many arguments

I am certain that i am just doing somthing wrong, i would appreciate a push
in the right direction though :)

Thanks in advance.
 
============
Nevin Swan
Hotline Support Total IT Solutions
Network Engineer
Ph: 8904 9777 Fax: 8904 9666
address@hidden
============






reply via email to

[Prev in Thread] Current Thread [Next in Thread]