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

Re: Little script help please



Our programmer, Andrew, tells me the problem is with the lines...
  if [ $hessian_colour="twotone" ]; then

The "=" set's $hession_colour to twotone and returns a TRUE to say the operation
has been successful.
You need to use a "==" to compare the two values.
For String comparisons, you should really use the word "eq".


Mervyn


ridgey wrote:

> Below is a script I am writing, what it does it take in values from webpage
> and basically just write them to a file. What I am trying to do is:  there
> is heap of different sections on the page, hessian, linen and more to be
> added.  I want the script to ONLY write to file the section that is selected
> and leave the rest out.  I think maybe I have done something wrong with the
> ifs as it writes every field to the file when I have specified no values so
> the file should be blank.
> Any help greatly appreciated.
>
> Ridgey
>
> /home/httpsd/temp/countryhats
> fi
> if [ $hessian_colour="twotone" ]; then
> echo "Hessian Selected" >> /home/httpsd/temp/countryhats
> echo "Twotone - First Tone Selected = $h_tone_one" >>
> /home/httpsd/temp/countryhats
> echo "Twotone - First Tone Selected = $h_tone_two" >>
> /home/httpsd/temp/country
> fi
> if [ $linen_colour="onecolour" ]; then
> echo "Linen Selected" >> /home/httpsd/temp/countryhats
> echo "One Colour - Colour Selected = $l_colour" >>
> /home/httpsd/temp/countryhats
> fi
>
> --
> To UNSUBSCRIBE, email to debian-isp-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

--
Mervyn Jack, Technical Director, Country Netlink Pty Ltd.
PO Box 529, Cobram, Vic. Australia, 3644
Ph +61 3 5871 1000 Fax +61 3 5871 1874 Mobile 0409 960 520
mailto:mervynj@cnl.com.au  http://www.cnl.com.au  ICQ 354419




Reply to: