TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: JOHN CARTER
from: ANDY BURNS
date: 2020-07-19 07:57:00
subject: Re: Strange construct in

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.

the open square bracket is usually

/usr/bin/[

which might be a hard or soft link to /usr/bin/test

> if [ ${GOV} = "ondemand" -a ${FORCE} = "1" ]

so that line expands to

if /usr/bin/test ${GOV} = "ondemand" -a ${FORCE} = "1"

the -a relates to the "test" command, not to the "if" statement.

the -a argmument to "test" can be used either to test for existence of a
file, or as in this case as a boolean "and" clause

I suspect your issue is that one of your bash variables is unset, or has
ended up with a special character in it, put echo ${GOV} and echo
${FORCE} statements in there for debugging ...

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.