[NTLUG:Discuss] what is ":bad option"?

Steve Baker sjbaker1 at airmail.net
Fri Jul 21 00:30:43 CDT 2000


m m wrote:

> another question: what is "bad option" mean?
> I try to run a script, the following happened:
> 
> #svscan start
> bash: svscan: command not found

...OK - so the directory containing the 'svscan' program
wasn't on your search path. So that command couldn't be
found - and BASH said so.
 
> #./svscan start
> : bad option
> 
> run the script in the same directory, and it is executable. Hhat's the
> problem?

Probably an actual syntax error somewhere inside the script.

It's hard to say what exactly.

Can you send us the contents of the script file? (Assuming it's not
too long that is!)

As I said before, the 'BASH' shell isn't my strong point.

If you can use 'tcsh', then there are some handy ways to
see what's going on inside the script.

Most tcsh scripts start off:

#!/bin/csh

...followed by tons of commands.  If you add:

set echo=1

...just after that first line - then the shell will print out
every line of the script as it's expanded out and just before
it's executed.  Noting which command is executed just before
it says ": bad option" should give you a good clue as to what
is broken.

Perhaps BASH can do something similar...dunno - I don't really
like BASH.

-- 
Steve Baker   HomeEmail: <sjbaker1 at airmail.net>
              WorkEmail: <sjbaker at link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net




More information about the Discuss mailing list