goto − transfer command
goto label [...]
Goto is allowed only when the shell is taking commands from a seekable command file (see lseek(2)).
The entire command file is searched for a line beginning with a : as the first non-blank character, followed by one or more blanks, and then the label. If such a line is found, goto repositions the command-file offset to the line after the label and exits. This causes the shell to transfer to the labelled line.
: is a special command which causes the shell to do nothing.
The goto command exits with one of the following values:
|
0 |
The label was found. |
|||
|
1 |
The label was not found. |
|||
|
2 |
An error was detected. |
if(1), osh(1), sh6(1)
Osh home page: http://v6shell.org/
The goto command from Sixth Edition UNIX requires : to be the first character on the labelled line. Otherwise, the label cannot be found.
This port differs in that : may be preceded by blanks. This allows labelled lines to be indented so that complex command files might be easier to read and understand.
A goto command appeared as /bin/goto in Third Edition UNIX.
See either the LICENSE file which is distributed with osh or http://v6shell.org/license/ for full details.
Copyright (c) 2004-2013
|
Jeffrey Allen Neitzel. All rights reserved. |
Copyright (c) 2001-2002
|
Caldera International Inc. All rights reserved. |