Here we go again..sheesh..:)

richard at richard at
Fri Nov 10 03:34:45 PST 2000

Misquoted from Horton, Robert on Wed, Nov 08, 2000 at 11:54:38AM -0700:
> Now however...
> I went thru the network install part, wrote the scripts, etc. Rebooted. I
> get this:
> /etc/rc3.d/S10ethnet: line 15: syntax error near unexpected token 'stop)'
> /etc/rc3.d/S10ethnet: line 15:'        stop)'
> Then I get the error that i am not supposed to see about this subscript
> returning a value of 2, etc...
> Now, I have triple checked my script. It looks just like in the book. I
> checked the localnet script as well, both of the stop) lines are very
> similar, so now I am stumped.
Many compilers and interpreters report the line on which they spotted the
error, not the line with the error. Bash is one of the worst interpreters
I have used in this respect.

The line with stop) on is probably correct. The fault is probably on the
line above, which I suspect should be:

The fault could be even further back, with a typo in:
case "$1" in

The idea of a case statement is to select different lumps of program,
depending on some word, in this case the expansion of "$1"

Each lump of program starts with "shell_pattern)" and ends with ";;"
The end of the case statement is marked by "esac"
The first lump of program whose shell_pattern matches the word is

In this case, I suspect "$1" expands to start, and the lump of program
for start is not terminated with a ;;, so bash tries to interpret "stop)"
as a command, instead of a shell pattern in a case statement.


help      # Explains bash commands to people who understand them
man bash  # Explains bash to insomniacs who understand shell scripting
info bash # Used to explain bash to people who understand
            Bourne Shell, Korn Shell, C-shell and others
            There has been a substantial re-write since I last read
            it, and it looks much better now

Bash-Prog-Intro-HOWTO # looks useful
HOWTOs can be retrieved via anonymous FTP from the following sites:


Unsubscribe: send email to lfs-discuss-request at
and put unsubscribe in the subject header of the message

More information about the lfs-dev mailing list