In article ,
John Carter wrote:
>The problem arises on the IF ststement. The error is too many
>parameters. It looks like the "-a" is something I have never seen in
>an IF statement and I can find no reference to it anywhere.
>
>if [ ${GOV} = "ondemand" -a ${FORCE} = "1" ]
-a is the logical AND operator. What's likely causing an error is if either
$GOV or $FORCE are empty, the command parses out to something like this:
if [ = "ondemand" -a = "1" ]
That obviously makes no sense. In any bash comparison, quote your
variables:
if [ "${GOV}" = "ondemand" -a "${FORCE}" = "1" ]
That way, if they're empty, the command parses like this:
if [ "" = "ondemand" -a "" = "1" ]
which evaluates as false, instead of returning an error.
_/_
/ v \ Scott Alfter (remove the obvious to send mail)
(IIGS( https://alfter.us/ Top-posting!
\_^_/ >What's the most annoying thing on Usenet?
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|