ksh.1 (2010 09)
k
ksh(1) ksh(1)
specified, resume at the n-th enclosing loop.
cd [ -L-P ][arg ]
cd old new This command can take either of two forms. In the first form it changes the current
directory to arg.Ifarg is -
the directory is changed to the previous directory. The -L
option (default) preserves logical naming when treating symbolic links.
cd -L ..
moves the current directory one path component closer to the root directory. The
-P
option preserves the physical path when treating symbolic links.
cd -P .. changes
the working directory to the parent directory of the current directory. The shell parame-
ter
HOME is the default arg. The parameter
PWD is set to the current directory. The
shell parameter
CDPATH defines the search path for the directory containing arg . Alter-
native directory names are separated by a colon (
:). If CDPATH is null or undefined, the
default value is the current directory. Note that the current directory is specified by a
null path name which can appear immediately after the equal sign or between the colon
delimiters anywhere else in the path list. If arg begins with a
/, the search path is not
used. Otherwise, each directory in the path is searched for arg . See also cd(1).
The second form of
cd substitutes the string new for the string old in the current direc-
tory name,
PWD and tries to change to this new directory.
The
cd command cannot be executed by
rksh.
echo [ arg ... ]
See echo (1) for usage and description.
% eval [ arg ... ]
Reads the arguments as input to the shell and executes the resulting command(s).
% exec [ arg ... ]
Parameter assignments remain in effect after the command completes. If arg is given,
the command specified by the arguments is executed in place of this shell without creat-
ing a new process. Input/output arguments can appear and affect the current process. If
no arguments are given, the effect of this command is to modify file descriptors as
prescribed by the input/output redirection list. In this case, any file descriptor numbers
greater than 2 opened with this mechanism are closed when invoking another program.
% exit [ n ] Causes the shell to exit with the exit status specified by n.Ifn is omitted, the exit status
is that of the last command executed. An end-of-file also causes the shell to exit, except
when a shell has the ignoreeof option set (see set below).
%% export [ name [=value ] ... ]
The given name s are marked for automatic export to the environment of subsequently
executed commands.
fc [ -eename ][-nlr ][first [ last ]]
fc -e - [ old=new ][command ]
In the first form, a range of commands from first to last is selected from the last
HIST-
SIZE commands typed at the terminal. The arguments first and last can be specified as
a number or string. A given string is used to locate the most recent command. A nega-
tive number is used to offset the current command number. The -l option causes the
commands to be listed on standard output. Otherwise, the editor program ename is
invoked on a file containing these keyboard commands. If ename is not supplied, the
value of the parameter FCEDIT (default /usr/bin/ed) is used as the editor. Once
editing has ended, the commands (if any) are executed. If last is omitted, only the com-
mand specified by first is used. If first is not specified, the default is the previous com-
mand for editing and −16 for listing. The -r option reverses the order of the commands
and the -n option suppresses command numbers when listing. In the latter, the com-
mand is re-executed after the substitution old=new is performed.
fg [ job ... ] Brings each job into the foreground in the order specified. If no job is specified, the
current job is brought into the foreground. See Jobs for a description of the format of job.
getopts optstring name [ arg ...]
Checks arg for legal options. If arg is omitted, the positional parameters are used. An
option argument begins with a + or a -. An option not beginning with + or -, or the
argument -- ends the options. optstring contains the letters that getopts recognizes. If
a letter is followed by a :, that option is expected to have an argument. The options can
be separated from the argument by blanks.
HP-UX 11i Version 3: September 2010 − 13 − Hewlett-Packard Company 13