goto - transfer command
is allowed only when the shell is taking commands from a seekable
command file (see lseek
The entire command file is searched for a line beginning with a :
first non-blank character, followed by one or more blanks, and then the
. If such a line is found, goto
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.
command exits with one of the following values:
- The label was found.
- The label was not found.
- An error was detected.
if(1), etsh(1), tsh(1)
Etsh home page: https://etsh.io/
command from Sixth Edition (V6) 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.
command appeared as /bin/goto
in Third Edition UNIX.
This port of the goto
command is derived from Sixth Edition (V6) UNIX
/usr/source/s1/goto.c. Presumably, Ken Thompson of Bell Labs wrote it. Jeffrey
Allen Neitzel <email@example.com
> ported and currently maintains it as
See either the LICENSE file which is distributed with etsh
https://etsh.io/license/ for full details.