--- Uli Fahrenberg <[EMAIL PROTECTED]> wrote:
> Allard Welter, Nov 1, 17:02 +0100:
>
> >> | > i've above error on boot every time (seems) a device try loading.
> >> | > It says also 'report this error to [EMAIL PROTECTED]'
>
> > I can't recal a colon being part of any
> > conditional - perhaps a typo?
>
> But I believe Allard is wrong above; IIRC this error is typically caused
> by a line like
>
> [ $X == blah ] && do_something
>
> which in case $X is empty becomes
>
> [ == blah ] ...
>
> and then bash complains that the [ is followed by an == operator.
>
> This kind of problem can be prevented by instead of the above test saying
>
> [ X$X == Xblah ] ...
You can also use
[ "$X" == "blah" ]
Both will have the same effect, but the quotes are a good habit to get into,
and they will save you in many places. Leaving quotes off can cause
unexpected results, as in the command
mv $OLD_FILE $NEW_FILE
If OLD_FILE has whitespace in it, it will be interpreted as two or more
different files. When a command like that appears in a script, it almost
always should actually be
mv "$OLD_FILE" "$NEW_FILE"
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page