GOTO(1)

NAME
goto - transfer command

SYNOPSIS
goto label [...]

DESCRIPTION
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.

EXIT STATUS
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.

SEE ALSO
if(1), osh(1), sh6(1)

Osh home page: http://v6shell.org/

COMPATIBILITY
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.

HISTORY
A goto command appeared as /bin/goto in Third Edition UNIX.

LICENSE
See either the LICENSE file which is distributed with osh or http://v6shell.org/license/ for full details.

COPYRIGHT
Copyright (c) 2004-2012
	Jeffrey Allen Neitzel.  All rights reserved.
Copyright (c) 2001-2002
	Caldera International Inc.  All rights reserved.