Lines Matching +full:command +full:- +full:line

3 .\"-
23 .\"-
27 .\" * - generates ‐ in gnroff, \- generates −, so .tr it to -
28 .\" thus use - for hyphens and \- for minus signs and option dashes
29 .\" * ~ is size-reduced and placed atop in groff, so use \*(TI
30 .\" * ^ is size-reduced and placed atop in groff, so use \*(ha
35 .\" be interpreted as punctuation, and especially with two-letter words
42 . if \*[.T]ascii .tr \-\N'45'
43 . if \*[.T]latin1 .tr \-\N'45'
44 . if \*[.T]utf8 .tr \-\N'45'
84 .\" with -mandoc, it might implement .Mx itself, but we want to
89 .\" Check which macro package we use, and do other -mdoc setup.
94 . ie d volume-ds-1 .ds tT gnu
95 . el .ie d doc-volume-ds-1 .ds tT gnp
105 . nr curr-font \n[.f]
106 . nr curr-size \n[.ps]
107 . ds str-Mx \f[\n[curr-font]]\s[\n[curr-size]u]
108 . ds str-Mx1 \*[Tn-font-size]\%MirBSD\*[str-Mx]
109 . if !\n[arg-limit] \
111 . ds macro-name Mx
112 . parse-args \$@
114 . if (\n[arg-limit] > \n[arg-ptr]) \{\
115 . nr arg-ptr +1
116 . ie (\n[type\n[arg-ptr]] == 2) \
117 . as str-Mx1 \~\*[arg\n[arg-ptr]]
119 . nr arg-ptr -1
121 . ds arg\n[arg-ptr] "\*[str-Mx1]
122 . nr type\n[arg-ptr] 2
123 . ds space\n[arg-ptr] "\*[space]
124 . nr num-args (\n[arg-limit] - \n[arg-ptr])
125 . nr arg-limit \n[arg-ptr]
126 . if \n[num-args] \
127 . parse-space-vector
128 . print-recursive
132 . ds tN \*[Tn-font-size]
137 . nr doc-curr-font \n[.f]
138 . nr doc-curr-size \n[.ps]
139 . ds doc-str-Mx \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]
140 . ds doc-str-Mx1 \*[doc-Tn-font-size]\%MirBSD\*[doc-str-Mx]
141 . if !\n[doc-arg-limit] \
143 . ds doc-macro-name Mx
144 . doc-parse-args \$@
146 . if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
147 . nr doc-arg-ptr +1
148 . ie (\n[doc-type\n[doc-arg-ptr]] == 2) \
149 . as doc-str-Mx1 \~\*[doc-arg\n[doc-arg-ptr]]
151 . nr doc-arg-ptr -1
153 . ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Mx1]
154 . nr doc-type\n[doc-arg-ptr] 2
155 . ds doc-space\n[doc-arg-ptr] "\*[doc-space]
156 . nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
157 . nr doc-arg-limit \n[doc-arg-ptr]
158 . if \n[doc-num-args] \
159 . doc-parse-space-vector
160 . doc-print-recursive
164 . ds tN \*[doc-Tn-font-size]
192 .\"-
201 .Bk -words
206 .Ar \&\-
216 .Nm builtin-name
220 is a command interpreter intended for both interactive and shell
222 Its command language is a superset of the
232 .Pa http://www.mirbsd.org/mksh\-faq.htm#sowhatismksh
238 .Bl -tag -width XcXstring
241 will execute the command(s) contained in
266 For non-interactive shells, the
270 command below).
275 .Ql \-
301 .Ql \-
310 .Bl -bullet -compact
315 command is disabled.
324 Command names can't be specified with absolute or relative paths.
328 option of the built-in command
329 .Ic command
339 The shell reads commands from standard input; all non-option arguments
361 .Pq Ql \&\- ,
367 built-in command can also be used on the command line:
378 option is specified, the first non-option argument specifies the name
380 If there are no non-option
385 option is used and there is a non-option argument, it is used as the name;
389 The exit status of the shell is 127 if the command file specified on the
390 command line could not be opened, or non-zero if a fatal syntax error
393 the exit status is that of the last command executed, or zero if no
394 command is executed.
400 A non-privileged login shell processes the user profile next.
401 A non-privileged interactive shell checks the value of the
403 parameter after subjecting it to parameter, command, arithmetic and tilde
407 it is processed; non-existence is silently ignored.
410 option given on the command line nor set during execution of the startup files.
411 .Ss Command syntax
412 The shell begins parsing its input by removing any backslash-newline
416 characters (space, tab and newline) or meta-characters
429 The meta-characters are used in building the following
445 is used to create co-processes (see
446 .Sx Co-processes
469 Whitespace and meta-characters can be quoted individually using a backslash
500 is used to introduce parameter, command and arithmetic substitutions (see
504 introduces an old-style command substitution (see
515 .Xr csh 1 Ns -style
530 .Em simple-commands ,
532 .Em compound-commands ,
539 A simple-command consists of some combination of parameter assignments
546 and command words; the only restriction is that parameter assignments come
547 before any command words.
548 The command words, if any, define the command
550 The command may be a shell built-in command, a function
551 or an external command
555 .Sx Command execution
557 Note that all command constructs have an exit status: for external commands,
560 (if the command could not be found, the exit status is 127; if it could not
561 be executed, the exit status is 126); the exit status of other command
562 constructs (built-in commands, functions, compound-commands, pipelines, lists,
563 etc.) are all well-defined and are described where the construct is
565 The exit status of a command consisting only of parameter
566 assignments is that of the last command substitution performed during the
567 parameter assignment or 0 if there were no command substitutions.
571 token to form pipelines, in which the standard output of each command but the
574 to the standard input of the following command.
575 The exit status of a pipeline is that of its last command, unless the
582 where all but the last command were executed in subshells; see the
611 is non-zero.
626 .Qq left-associative .
629 .Bd -literal -offset indent
636 token causes the preceding command to be executed asynchronously; that is,
637 the shell starts the command but does not wait for it to complete (the shell
641 When an asynchronous command is started when job control is disabled
642 (i.e. in most scripts), the command is started with signals
648 (however, redirections specified in the asynchronous command have precedence).
651 operator starts a co-process which is a special kind of asynchronous process
653 .Sx Co-processes
655 Note that a command must follow the
664 The exit status of a list is that of the last command executed, with the
670 word of a command (i.e. they can't be preceded by parameter assignments or
672 .Bd -literal -offset indent
679 In the following compound command descriptions, command lists (denoted as
684 .Bd -literal -offset indent
693 .Bl -tag -width 4n
723 patterns are subject to parameter, command and arithmetic substitution, as
736 .Bl -tag -width 4n
742 Evaluate the remaining pattern-list tuples.
793 .It Ar name Ns \&() Ar command
830 fail (i.e. exit with non-zero status), the
837 statement is that of whatever non-conditional
840 that is executed; if no non-conditional
867 If a blank line (i.e. zero or more
877 This process continues until an end-of-file
885 statement is used to exit the loop, non-zero otherwise.
899 .Sx Command execution
912 is non-zero.
918 is a pre-checked loop.
935 .Bl -bullet
951 .Dq Ic \-f ,
956 Parameter, command and arithmetic substitutions are performed as expressions
967 .Bd -literal -offset indent
968 $ [[ \-r foo && $(\*(Ltfoo) = b*r ]]
979 .Bd -literal -offset indent
994 are reserved words, not meta-characters.
1010 command and
1020 quotes the following character, unless it is at the end of a line, in which
1039 or command substitution) except no field splitting is carried out on the
1040 results of double-quoted substitutions, and the old-style form of command
1041 substitution has backslash-quoting for double quotes enabled.
1044 inside a double-quoted string is followed by
1059 If a single-quoted string is preceded by an unquoted
1063 the expanded result is treated as any other single-quoted string.
1064 If a double-quoted string is preceded by an unquoted
1093 Universal Coded Character Set codepoint to UTF-8 (see
1121 In C style mode, raw octet-yielding octal sequences
1128 as they can and terminate with the first non-xdigit; below
1137 .Ic Ctrl- Ns Li % ,
1148 There are two types of aliases: normal command aliases and tracked aliases.
1149 Command aliases are normally used as a short hand for a long or often used
1150 command.
1151 The shell expands command aliases (i.e. substitutes the alias name
1152 for its value) when it reads the first word of a command.
1153 An expanded alias is re-processed to check for more aliases.
1154 If a command alias ends in a
1160 to work in scripts and on the command line in some cases, aliases are
1161 expanded during lexing, so their use must be in a separate command tree
1163 Noticeably, command lists (separated by semicolon, in command substitutions
1166 The following command aliases are defined automatically by the shell:
1167 .Bd -literal -offset indent
1168 autoload=\*(aq\e\ebuiltin typeset \-fu\*(aq
1169 functions=\*(aq\e\ebuiltin typeset \-f\*(aq
1170 hash=\*(aq\e\ebuiltin alias \-t\*(aq
1171 history=\*(aq\e\ebuiltin fc \-l\*(aq
1172 integer=\*(aq\e\ebuiltin typeset \-i\*(aq
1175 nameref=\*(aq\e\ebuiltin typeset \-n\*(aq
1177 r=\*(aq\e\ebuiltin fc \-e \-\*(aq
1178 type=\*(aq\e\ebuiltin whence \-v\*(aq
1182 command.
1183 The first time the shell does a path search for a command that is
1184 marked as a tracked alias, it saves the full path of the command.
1186 time the command is executed, the shell checks the saved path to see that it
1200 This option is set automatically for non-interactive shells.
1222 The first step the shell takes in executing a simple-command is to perform
1223 substitutions on the words of the command.
1225 substitution: parameter, command and arithmetic.
1231 command substitutions take the form
1232 .Pf $( Ns Ar command Ns \&)
1234 .Pf \` Ns Ar command Ns \`
1236 .Pf ${\ \& Ar command Ns \&;}
1240 Parsing the current-environment command substitution requires a space,
1253 .Pf ${\*(Ba\& Ns Ar command Ns \&;}
1256 the, initially empty, expression-local variable
1259 .Ar command Ns s .
1277 .Pf non- Ev IFS
1283 .Pf non- Ev IFS
1328 A command substitution is replaced by the output generated by the specified
1329 command which is run in a subshell.
1331 .Pf $( Ns Ar command Ns \&)
1333 .Pf ${\*(Ba\& Ns Ar command Ns \&;}
1335 .Pf ${\ \& Ar command Ns \&;}
1337 .Ar command
1339 .Pf \` Ns Ar command Ns \`
1349 when the substitution is part of a double-quoted string); a backslash
1352 As a special case in command substitutions, a command of the form
1361 Note that some shells do not use a recursive parser for command substitutions,
1364 (or the newline-keeping
1367 .St -p1003.1
1371 .Bd -literal -offset indent
1380 For example, the command
1405 That is, they are a 32-bit unsigned integer.
1442 Third, parameters can be assigned values on the command line: for example,
1448 multiple parameter assignments can be given on a single command line and they
1449 can be followed by a simple-command, in which case the assignments are in
1450 effect only for the duration of the command (such assignments are also
1458 the old and new values are string-concatenated with no separator.
1465 .Sx Command execution
1496 The order in which parameters appear in the environment of a command is
1505 .Bl -tag -width Ds
1507 .It ${ Ar name No :\- Ar word No }
1547 built-in).
1558 The parsing rules also differ on whether the expression is double-quoted:
1560 then uses double-quoting rules, except for the double quote itself
1571 is needed, parameter, command, arithmetic and tilde substitution are performed
1578 .Bl -tag -width Ds -compact
1600 or \-1 if
1613 command (which is an alias for
1757 A quoted expression safe for re-entry, whose value is the value of the
1776 .Bl -tag -width "1 .. 9"
1789 .It Ev \-
1792 command below for a list of options).
1794 The exit status of the last non-asynchronous command executed.
1795 If the last command was killed by a signal,
1817 built-in.
1843 .Bl -tag -width "KSH_VERSION"
1846 When an external command is executed by the shell, this parameter is set in the
1847 environment of the new process to the path of the executed command.
1849 word of the previous command.
1857 built-in command.
1865 built-in command will display the resulting directory when a match is found
1872 is non-zero and sane enough (minimum is 12x3), defaults to 80; similar for
1874 This parameter is used by the interactive line editing modes and by the
1906 command (see below).
1912 It is also searched when a command can't be found using
1918 The name of the file used to store command history.
1940 command and the value substituted for an unqualified
1948 command, to split values into distinct arguments; normally set to space, tab
1967 Set by string comparisons (= and !=) in double-bracket test
2028 The name (self-identification) and version of the shell (read-only).
2035 The line number of the function or shell script that is currently being
2062 command (see below).
2078 Parameter, command and arithmetic
2081 is replaced with the current command number (see the
2083 command below).
2093 for non-root users,
2112 root-vs-user distinguishing clause are (in this example) executed at
2116 .Bd -literal
2117 PS1=\*(aq${USER:=$(id \-un)}\*(aq"@${HOSTNAME:=$(hostname)}:\e$PWD $(
2121 Note that since the command-line editors try to figure out how long the prompt
2126 character (such as Ctrl-A) followed by a carriage return and then delimiting
2133 if you did not have any non-printing characters.
2149 .Bd -literal -offset indent
2157 .Bd -literal -offset indent
2163 used when more input is needed to complete a command.
2173 command below).
2174 Parameter, command and arithmetic substitutions are performed
2192 command if no names are given.
2219 In parameter assignments (such as those preceding a simple-command or those
2226 completion for tildes after all unquoted colons during command line editing.
2234 .Ql \- ,
2248 The home directory of previously expanded login names are cached and re-used.
2251 command may be used to list, change and add to this cache (e.g.\&
2252 .Ic alias \-d fac=/usr/local/facilities; cd \*(TIfac/bin ) .
2255 .Bd -unfilled -offset indent
2305 .Bl -tag -width Ds
2313 .Ql \-
2315 .Dq Li \&[a0\-9]
2320 .Ql \-
2433 When a command is executed, its standard input, standard output and standard
2442 .Bl -tag -width XXxxmarker
2451 Note that this means the command
2483 After reading the command line containing this kind of redirection (called a
2485 the shell copies lines from the command source into a temporary file until a
2486 line matching
2489 When the command is executed, standard input is redirected from the
2494 as if enclosed in double quotes each time the command is executed, so
2495 parameter, command and arithmetic substitutions are performed, along with
2506 If multiple here documents are used on the same command line, they are saved in
2520 quotes with nothing in between, the here document ends at the next empty line
2522 .It \*(Lt\*(Lt\- Ns Ar marker
2542 co-process; or the character
2543 .Ql \- ,
2586 Parameter, command and arithmetic
2600 For simple-commands, redirections may appear anywhere in the command; for
2601 compound-commands
2609 will print an error with a line number prepended to it:
2611 .Dl $ cat /foo/bar 2\*(Gt&1 \*(Gt/dev/null \*(Ba pr \-n \-t
2617 command, inside $((...)) expressions, inside array references (e.g.\&
2621 command, and as the value of an assignment to an integer parameter.
2625 command.
2631 type (a 32-bit signed integer), unless they begin with a sole
2635 .Po a 32-bit unsigned integer Pc .
2637 Expressions may contain alpha-numeric parameter identifiers, array references
2642 .Bd -literal -offset indent
2643 + \- ! \*(TI ++ \-\-
2647 .Bd -literal -offset indent
2649 = += \-= *= /= %= \*(Lt\*(Lt= \*(Gt\*(Gt= \*(ha\*(Lt= \*(ha\*(Gt= &= \*(ha= \*(Ba=
2658 + \-
2663 .Bd -literal -offset indent
2668 .Bd -literal -offset indent
2672 Integer constants and expressions are calculated using an exactly 32-bit
2681 Additionally, base-16 integers may be specified by prefixing them with
2683 .Pq case-insensitive
2686 built-in utility.
2694 extension, numbers to the base of one are treated as either (8-bit
2697 .Ic utf8\-mode
2718 for UTF-8 mode handling.
2721 .Bl -tag -width Ds -offset indent
2724 .It unary \-
2730 Arithmetic (bit-wise) NOT.
2737 .It \-\-
2742 Separates two arithmetic expressions; the left-hand side is evaluated first,
2744 The result is the value of the expression on the right-hand side.
2748 .No += \-= *= /= %= \*(Lt\*(Lt= \*(Gt\*(Gt=
2775 the result is 1 if either argument is non-zero, 0 if not.
2779 the result is 1 if both arguments are non-zero, 0 if not.
2780 The right argument is evaluated only if the left argument is non-zero.
2782 Arithmetic (bit-wise) OR.
2784 Arithmetic (bit-wise) XOR
2785 (exclusive-OR).
2787 Arithmetic (bit-wise) AND.
2807 .It + \- * /
2828 is non-zero, the result is
2832 The non-result argument is not evaluated.
2834 .Ss Co-processes
2835 A co-process (which is a pipeline created with the
2841 The input and output of the co-process can also be manipulated using
2846 Once a co-process has been started, another can't
2847 be started until the co-process exits, or until the co-process's input has been
2851 If a co-process's input is redirected in this way, the next
2852 co-process to be started will share the output with the first co-process,
2853 unless the output of the initial co-process has been redirected using an
2857 Some notes concerning co-processes:
2858 .Bl -bullet
2860 The only way to close the co-process's input (so the co-process reads an
2861 end-of-file) is to redirect the input to a numbered file descriptor and then
2863 .Ic exec 3\*(Gt&p; exec 3\*(Gt&\-
2865 In order for co-processes to share a common output, the shell must keep the
2867 This means that end-of-file will not be
2868 detected until all co-processes sharing the co-process's output have exited
2875 portion of the co-process output when the most recently started co-process
2876 (instead of when all sharing co-processes) exits.
2882 is true if the co-process input has been duplicated to another file descriptor
2889 .Ic function Ar function-name
2891 .Ar function-name Ns \&()
2897 built-in)
2903 When the shell is determining the location of a command, functions
2904 are searched after special built-in commands, before builtins and the
2909 .Ic unset Fl f Ar function-name .
2916 command (which is an alias for
2924 be defined, the function is executed; otherwise, the normal command search is
2925 continued (i.e. the shell searches the regular built-in command table and
2927 Note that if a command is not found using
2953 command can be used inside a function to create a local parameter.
2965 The exit status of a function is that of the last command executed in the
2969 command; this may also be used to explicitly specify the exit status.
2983 .Bl -bullet
2986 (Bourne-style functions leave $0 untouched).
2991 can be used properly both inside and outside the function (Bourne-style
3006 .Bl -bullet
3017 .Ss Command execution
3018 After evaluation of command-line arguments, redirections and parameter
3019 assignments, the type of command is determined: a special built-in command,
3024 Special built-in commands differ from other commands in that the
3027 cause a non-interactive shell to exit, and parameter assignments that are
3028 specified before the command are kept after the command completes.
3029 Regular built-in commands are different only in that the
3033 POSIX special built-in utilities:
3049 .Ic builtin , cat , cd , command ,
3057 Once the type of command has been determined, any command-line parameter
3058 assignments are performed and exported for the duration of the command.
3060 The following describes the special and regular built-in commands and
3061 builtin-like reserved words, as well as some optional utilities:
3063 .Bl -tag -width false -compact
3068 command.
3079 those of the environment the command is used in.
3083 The null command.
3145 .Li \&[][A\-Za\-z0\-9_!%+,.@:\-]
3146 are valid in names, except they may not begin with a plus or hyphen-minus, and
3160 is given on the command line, only
3180 with the command are ignored for tracked aliases).
3194 .Pq built-in alias
3226 .Ar string Ns = Ns Op Ar editing-command
3238 .Ar editing-command
3241 will immediately invoke that editing command.
3248 will be replaced by the given NUL-terminated
3257 .No Ctrl- Ns Li Z .
3261 are supported, some multi-character sequences can be supported.
3267 inner-most
3279 .Op Fl \-
3280 .Ar command Op Ar arg ...
3283 Execute the built-in command
3284 .Ar command .
3288 .Ar command Op Ar arg ...
3290 .Pq regular , decl-forwarder
3296 .No iff Ar command
3305 Copy files in command line order to standard output.
3309 .Pq Dq Li \-
3314 option is supported as a no-op.
3356 .Dq Li \- ,
3367 command below), references to
3415 .Ic command
3420 .Pq regular , decl-forwarder
3428 .Ic command
3433 and secondly, special built-in commands lose their specialness
3435 exit, and command assignments are not permanent).
3440 system-dependent, is used instead of the current
3449 for aliases, a command that defines them is printed;
3452 parameter, the full path of the command is printed.
3453 If no command is found
3455 .Ic command
3456 exits with a non-zero status.
3467 inner-most
3483 causes line wrapping before 80 columns, whereas
3489 Execute the last command with
3499 this utility is not portable; use the standard Korn shell built-in utility
3510 command below for a list of other backslash sequences that are recognised.
3532 .Dq Li \-n .
3541 Hide and unhide built-in utilities, aliases and functions and those defined in
3551 .Dq Li \-n\ \&
3554 is given) or re-enabled.
3564 .It Ic eval Ar command ...
3574 .Op Ar command Op Ar arg ...
3577 The command (with arguments) is executed without forking,
3581 .Ar command
3593 If no command is given except for I/O redirection, the I/O redirection is
3599 that are not built-in to the shell).
3615 .Pq keeps assignments , special, decl-util
3622 set are printed one per line: either their names, or, if a
3623 .Dq Li \-
3628 commands suitable for re-entry.
3632 Null command required for shebang-like functionality.
3636 A command that exits with a non-zero status.
3651 (negative numbers go backwards from the current, most recent, line)
3652 or a string specifying the most recent command starting with that string.
3655 option lists the command on standard output, and
3657 inhibits the default command numbers.
3675 .Cm \-e \- \*(Ba Fl s
3681 Re-execute the selected command (the previous command by default) after
3693 .Cm \-e \-
3696 is identical: re-execute the selected command without invoking an editor.
3697 This command is usually accessed with the predefined:
3698 .Ic alias r=\*(aqfc \-e \-\*(aq
3712 .Pq built-in alias
3764 returns a non-zero exit status.
3766 .Ql \-
3767 .Pq non-option argument
3769 .Dq Li \-\-
3790 .Pq built-in alias
3791 Without arguments, any hashed executable command paths are listed.
3797 is searched as if it were a command name
3798 and added to the cache if it is an executable command.
3809 .Pq built-in alias
3820 .Pq built-in alias
3851 .No \- Ns Ar signum \*(Ba
3852 .No \- Ns Ar signame Oc
3871 .Op Ar exit-status ...
3875 .Ar exit-status .
3885 0 (1) if the last expression evaluated to non-zero (zero).
3900 .Pq built-in alias
3948 .Pq built-in alias
3983 .Bl -tag -width XuXnX
3993 The output is printed columnised, line by line, similar to how the
3997 built-in utility and the
4006 Change the output word and line separator to ASCII NUL.
4008 Do not print the trailing line separator.
4010 Print to the co-process (see
4011 .Sx Co-processes
4028 command which does not expand backslashes and interprets
4030 .Dq Li \-n
4036 .Tn POSIX Ns -mandated
4097 .Pq built-in alias
4114 Reads a line of input, separates the input into fields using the
4129 .Bl -tag -width XuXnX
4143 .Ic utf8\-mode
4153 Instead of reading till end-of-line, read exactly
4161 Instead of reading till end-of-line, read up to
4166 Read from the currently active co-process (see
4167 .Sx Co-processes
4187 strips backslash-newline sequences and any remaining backslashes from input.
4190 The input line is saved to the history.
4198 they read an entire file if \-1 is passed as
4211 exits with a non-zero status.
4220 .Pq keeps assignments , special, decl-util
4221 Sets the read-only attribute of the named parameters.
4224 Once a parameter is made read-only,
4227 If no parameters are specified, the names of all parameters with the read-only
4228 attribute are printed one per line, unless the
4232 commands defining all read-only parameters, including their values, are
4237 .Op Fl \-
4251 resolving to an extant non-directory is also treated as error.
4255 .Op Fl \-
4277 is given, the exit status of the last executed command is used.
4294 ROT13-encrypts/-decrypts stdin to stdout.
4300 .Op Fl \-
4306 command can be used to show all shell parameters
4307 .Pq like Ic typeset \- ,
4309 .Pq Ic \-
4325 .Bl -tag -width 3n
4344 An alternative syntax for the command
4345 .Ic set \-A foo \-\- a b c;
4346 .Ic set \-A foo+ \-\- d e
4375 trap) as soon as an error occurs or a command fails (i.e. exits with a
4376 non-zero status).
4390 only the status of the last command is tested.
4397 Enabled by default for non-interactive shells.
4403 Parameter assignments are recognised anywhere in a command.
4437 command it causes the specified arguments to be sorted ASCIIbetically
4442 .It Fl U \*(Ba Fl o Ic utf8\-mode
4443 Enable UTF-8 support in the
4447 shell command line; is enabled automatically for interactive shells if
4459 .Dq UTF\-8
4462 case-insensitively; for direct builtin calls depending on the
4464 if the input begins with a UTF-8 Byte Order Mark.
4470 locale-related environment variables changes.
4477 .Ql \- ,
4497 Enable BRL emacs-like command-line editing (interactive shells only); see
4501 Enable gmacs-like command-line editing (interactive shells only).
4503 .Li transpose\-chars Pq \*(haT
4506 The shell will not (easily) exit when end-of-file is read;
4512 .It Fl o Ic inherit\-xtrace
4551 command changes
4559 Make the exit status of a pipeline the rightmost non-zero errorlevel,
4567 .Sq \-
4578 .Ic utf8\-mode
4580 .Pq unless both are set in the same command
4590 .Sq \-
4601 mode (unless both are set in the same command).
4604 .Xr vi 1 Ns -like
4605 command-line editing (interactive shells only).
4609 .It Fl o Ic vi\-esccomplete
4610 In vi command-line editing, do command and file name completion when Esc
4612 is entered in command mode.
4613 .It Fl o Ic vi\-tabcomplete
4614 In vi command-line editing, do command and file name completion when Tab
4621 was set, the vi command-line mode would let the
4631 .Dq Li $\- .
4635 prints a command to restore the current option set, using the internal
4643 .Dq Li \-\-
4646 .Dq Li \-
4719 It is often used as the condition command of
4733 .Bl -tag -width 17n
4760 is a context dependent directory (only useful on HP-UX).
4785 .Xr unix 4 Ns -domain
4829 has non-zero length.
4845 command above for a list of options).
4846 As a non-standard extension, if the option starts with a
4850 doesn't exist (so [ \-o foo \-o \-o !foo ] returns true if and only if option
4853 The same can be achieved with [ \-o ?foo ] like in
4858 .Ql \-
4863 .Dq Li \-x
4872 occurs if the right-hand string isn't quoted.
4903 .Bd -literal -offset indent
4904 expr \-o expr Logical OR.
4905 expr \-a expr Logical AND.
4912 .Bd -literal -offset indent
4913 x=1; [ "x" \-eq 1 ] evaluates to true
4927 lower four- and three-argument forms to two- and one-argument forms,
4928 respectively; three-argument forms ultimately prefer binary operations,
4929 followed by negation and parenthesis lowering; two- and four-argument forms
4930 prefer negation followed by parenthesis; the one-argument form always implies
4944 .Dq Li \-n .
4947 instead, or the double-bracket operator (see
4982 is a simple command), the output is slightly longer:
4983 .Bd -literal -offset indent
4995 Times for the first command do not go to
4997 but those of the second command do.
5004 .Bd -literal -offset indent
5015 .Pq Dq Li \-
5027 .Pq Dq Li \- ,
5031 (i.e. when the current command completes or before printing the next
5047 command above).
5061 handlers are executed in the environment of the last executed command.
5070 Note that, for non-interactive shells, the trap handler cannot be changed
5084 A command that exits with a zero status.
5087 .Pq built-in alias
5090 would be interpreted as command.
5108 .Pq keeps assignments , decl-util
5116 .Dq Li \-
5130 .Pq Ic \&\-
5154 .Bl -tag -width Ds
5217 commands that can be used to re-create the attributes and values of
5231 Read-only attribute.
5297 unless they are also given on the same command line.
5320 .Bl -tag -width 5n
5342 On some systems, read-only maximum
5414 Set the maximum real-time priority to
5509 The exit status is non-zero if any of the parameters are read-only,
5519 .Ic kill Fl l Ar exit-status
5550 .Ic command Fl v ,
5555 .Ic command Fl V .
5607 subshell commands and non-built-in, non-function commands) can be stopped;
5616 command is run.
5624 commands either by the process ID of the last process in the command pipeline
5630 .Bl -tag -width "%+ x %% x %XX"
5634 .It %\-
5642 The job with its command containing the string
5646 The job with its command starting with the string
5654 .D1 [ Ns Ar number ] Ar flag status command
5657 .Bl -tag -width "command"
5664 .Ql \-
5668 .Ic %\-
5672 .Bl -tag -width "RunningXX"
5686 .It Ar signal-description Op Dq core dumped
5694 .It Ar command
5695 is the command that created the process.
5697 the job, each process will have a line showing its
5698 .Ar command
5719 The state of the controlling terminal can be modified by a command
5722 for later command invocations if the command exits successfully (i.e.\&
5726 In interactive mode, when line editing is enabled, the terminal state is
5727 saved before being reconfigured by the shell for the line editor, then
5728 restored before running a command.
5739 will still operate with unsigned 32-bit arithmetic; use
5749 .Nm ksh Ns -compatible
5751 .Bl -bullet
5769 Alias expansion with a trailing space only reruns on command words.
5779 only lists signal names, all in one line.
5793 .Bl -bullet
5809 .Ev \-DMKSH_MIDNIGHTBSD01ASH_COMPAT .
5846 .Fl \-
5848 .Ev \-DMKSH_MIDNIGHTBSD01ASH_COMPAT .
5850 .Ss Interactive input line editing
5851 The shell supports three modes of reading command lines from a
5863 built-in.
5872 option is set, the shell allows emacs-like editing of the command; similarly,
5875 option is set, the shell allows vi-like editing of the command.
5878 In these editing modes, if a line is longer than the screen width (see the
5889 The line is scrolled horizontally as necessary.
5892 IFS octet or IFS white space or are the same as the previous line.
5896 option is set, interactive input line editing is enabled.
5906 command.
5909 Each description starts with the name of the command,
5913 (if the command can be prefixed with a count); and any keys the command is
5917 A count prefix for a command is entered using the sequence
5925 Note that editing command names are used only with the
5927 command.
5939 .Bl -tag -width Ds
5944 Abort the current command, save it to the history, empty the line buffer and
5946 .It auto\-insert: Op Ar n
5949 .It Xo backward\-char:
5951 .No \*(haB , \*(haXD , ANSI-CurLeft , PC-CurLeft
5956 .It Xo backward\-word:
5958 .No \*(ha[b , ANSI-Ctrl-CurLeft , ANSI-Alt-CurLeft
5966 .It beginning\-of\-history: \*(ha[\*(Lt
5968 .It beginning\-of\-line: \*(haA, ANSI-Home, PC-Home
5969 Moves the cursor to the beginning of the edited input line.
5970 .It Xo capitalise\-word:
5977 .It clear\-screen: \*(ha[\*(haL
5978 Prints a compile-time configurable sequence to clear the screen and home
5979 the cursor, redraws the last line of the prompt string and the currently
5980 edited input line.
5983 If the current line does not begin with a comment character, one is added at
5984 the beginning of the line and the line is entered (as if return had been
5986 is placed at the beginning of the line.
5988 Automatically completes as much as is unique of the command name or the file
5990 If the entire remaining command or file name is
5995 If there is no command or file name with the current partial word
5998 .It complete\-command: \*(haX\*(ha[
5999 Automatically completes as much as is unique of the command name having the
6002 command above.
6003 .It complete\-file: \*(ha[\*(haX
6007 command described above.
6008 .It complete\-list: \*(haI, \*(ha[=
6014 command above.
6016 .It Xo delete\-char\-backward:
6024 .It Xo delete\-char\-forward:
6026 .No ANSI-Del , PC-Del
6031 .It Xo delete\-word\-backward:
6040 .It Xo delete\-word\-forward:
6047 .It Xo down\-history:
6049 .No \*(haN , \*(haXB , ANSI-CurDown , PC-CurDown
6054 Each input line originally starts just after the last entry
6056 .Ic down\-history
6058 .Ic search\-history ,
6059 .Ic search\-history\-up
6061 .Ic up\-history
6063 .It Xo downcase\-word:
6070 .It Xo edit\-line:
6074 Internally run the command
6075 .Ic fc \-e \&"${VISUAL:\-${EDITOR:\-vi}}" Fl \- Ar n
6077 on a temporary script file to interactively edit line
6081 is not specified, the current line); then, unless the editor invoked
6083 resulting script as if typed on the command line; both the edited
6086 .It end\-of\-history: \*(ha[\*(Gt
6088 .It end\-of\-line: \*(haE, ANSI-End, PC-End
6089 Moves the cursor to the end of the input line.
6091 Acts as an end-of-file; this is useful because edit-mode input disables
6093 .It Xo eot\-or\-delete:
6097 If alone on a line, same as
6100 .Ic delete\-char\-forward .
6103 .It evaluate\-region: \*(ha[\*(haE
6105 .Pq the entire line if no mark is set
6108 .It exchange\-point\-and\-mark: \*(haX\*(haX
6110 .It expand\-file: \*(ha[*
6116 .It Xo forward\-char:
6118 .No \*(haF , \*(haXC , ANSI-CurRight , PC-CurRight
6123 .It Xo forward\-word:
6125 .No \*(ha[f , ANSI-Ctrl-CurRight , ANSI-Alt-CurRight
6130 .It Xo goto\-history:
6136 .It Xo kill\-line:
6139 Deletes the entire input line.
6140 .It kill\-region: \*(haW
6142 .It Xo kill\-to\-eol:
6146 Deletes the input from the cursor to the end of the line if
6151 Prints a sorted, columnated list of command names or file names (if any) that
6156 .It list\-command: \*(haX?
6157 Prints a sorted, columnated list of command names (if any) that can complete
6159 .It list\-file: \*(haX\*(haY
6166 Causes the current input line to be processed by the shell.
6167 The current cursor position may be anywhere on the line.
6168 .It newline\-and\-next: \*(haO
6169 Causes the current input line to be processed by the shell, and the next line
6170 from history becomes the current line.
6172 .Ic up\-history ,
6173 .Ic search\-history
6175 .Ic search\-history\-up .
6176 .It Xo no\-op:
6180 .It prefix\-1: \*(ha[
6181 Introduces a 2-character command sequence.
6182 .It prefix\-2: \*(haX , \*(ha[[ , \*(ha[O
6183 Introduces a multi-character command sequence.
6184 .It Xo prev\-hist\-word:
6190 word (zero-based) of the previous (on repeated execution, second-last,
6191 third-last, etc.) command is inserted at the cursor.
6192 Use of this editing command trashes the mark.
6194 The following character is taken literally rather than as an editing command.
6195 .It quote\-region: \*(ha[Q
6197 .Pq the entire line if no mark is set
6198 into a shell command argument.
6200 Reprints the last line of the prompt string and the current input line
6201 on a new line.
6202 .It Xo search\-character\-backward:
6206 Search backward in the current line for the
6209 .It Xo search\-character\-forward:
6213 Search forward in the current line for the
6216 .It search\-history: \*(haR
6225 .Ic prefix\-1
6227 .Ic prefix\-1
6229 .Ic prefix\-2
6233 command will restore the input line before search started.
6235 .Ic search\-history
6240 .It search\-history\-up: ANSI-PgUp, PC-PgUp
6242 the portion of the input line before the cursor.
6243 When used on an empty line, this has the same effect as
6244 .Ic up\-history .
6245 .It search\-history\-down: ANSI-PgDn, PC-PgDn
6247 the portion of the input line before the cursor.
6248 When used on an empty line, this has the same effect as
6249 .Ic down\-history .
6251 .Ic up\-history ,
6252 .Ic search\-history
6254 .Ic search\-history\-up .
6255 .It set\-mark\-command: \*(ha[ Ns Aq space
6257 .It transpose\-chars: \*(haT
6258 If at the end of line or, if the
6263 .It Xo up\-history:
6265 .No \*(haP , \*(haXA , ANSI-CurUp , PC-CurUp
6270 .It Xo upcase\-word:
6284 .It yank\-pop: \*(ha[y
6291 .Bd -literal
6292 print \-nr \-\- "${x@/[\e"\-\e$\e&\-*:\-?[\e\e\e`\e{\-\e}${IFS\-$\*(aq \et\en\*(aq}]/\e\e$KSH_MATCH…
6296 The vi command-line editing mode has not yet been brought up to the
6298 It is 8-bit clean but specifically does not support UTF-8 or MBCS.
6300 The vi command-line editor in
6305 .Bl -bullet
6309 There are file name and command completion commands:
6317 command is different (in
6319 it is the last argument command; in
6321 it goes to the start of the current line).
6329 command.
6331 Commands which don't make sense in a single line editor are not available
6333 .Xr ex 1 Ns -style
6344 .Dq command
6358 .Bl -tag -width XJXXXXM
6360 Command and file name enumeration (see below).
6362 Command and file name completion (see below).
6369 End of line.
6370 The current line is read, parsed and executed by the shell.
6376 Command and file name expansion (see below).
6378 Puts the editor in command mode (see below).
6380 Optional file name and command completion (see
6383 .Ic set Fl o Ic vi\-tabcomplete .
6386 In command mode, each character is interpreted as a command.
6390 In the following command descriptions, an
6392 indicates the command may be prefixed by a number (e.g.\&
6404 non-letter, non-digit, non-underscore and non-whitespace characters (e.g.\&
6407 .Dq big-word
6408 is a sequence of non-whitespace characters.
6416 .Bl -tag -width 10n
6422 big-word from the last command in the history at the current position and enter
6429 at the start of the current line and return the line to the shell (equivalent
6439 is not specified, it goes to the most recent remembered line.
6443 Internally run the command
6444 .Ic fc \-e \&"${VISUAL:\-${EDITOR:\-vi}}" Fl \- Ar n
6446 on a temporary script file to interactively edit line
6450 is not specified, the current line); then, unless the editor invoked
6452 resulting script as if typed on the command line; both the edited
6456 Command or file name expansion is applied to the current big-word (with an
6459 if the word contains no file globbing characters)\*(EMthe big-word is replaced
6461 If the current big-word is the first on the line
6471 then command expansion is done; otherwise file name expansion is done.
6472 Command expansion will match the big-word against all aliases, functions and
6473 built-in commands as well as any executable files found by searching the
6477 File name expansion matches the big-word against the files in the
6488 Command/file name completion.
6489 Replace the current big-word with the
6490 longest unique match obtained after performing command and file name expansion.
6493 .Ic vi\-tabcomplete
6497 .Ic vi\-esccomplete
6504 possible completion is selected (as reported by the command/file name
6505 enumeration command).
6507 Command/file name enumeration.
6508 List all the commands or files that match the current big-word.
6520 Intra-line movement commands:
6521 .Bl -tag -width Ds
6539 Move to the first non-whitespace character.
6558 big-words.
6568 Move forward to the end of the big-word,
6582 big-words.
6622 command.
6630 command, but moves in the opposite direction.
6633 Inter-line movement commands:
6634 .Bl -tag -width Ds
6643 next line in the history.
6646 .Oo Ar n Oc Ns \- ,
6652 previous line in the history.
6656 Move to line
6660 is not specified, the number of the first remembered line is used.
6668 is not specified, it goes to the most recent remembered line.
6674 line containing
6680 the remainder of the string must appear at the start of the history line for
6702 .It Ar ANSI-CurUp , PC-PgUp
6703 Take the characters from the beginning of the line to the current
6707 .It Ar ANSI-CurDown , PC-PgDn
6708 Take the characters from the beginning of the line to the current
6715 .Bl -tag -width Ds
6723 only replicated if command mode is re-entered i.e.\&
6731 except it appends at the end of the line.
6739 replicated if command mode is re-entered i.e.\&
6747 except the insertion is done just before the first non-blank character.
6755 Substitute whole line.
6756 All characters from the first non-blank character to the
6757 end of the line are deleted and insert mode is entered.
6759 .Oo Ar n Oc Ns c Ns Ar move-cmd
6762 .Ar n move-cmd Ns s
6764 .Ar move-cmd
6767 the line starting from the first non-blank character is changed.
6769 Change from the current position to the end of the line (i.e. delete to the
6770 end of the line and go into insert mode).
6784 Delete to the end of the line.
6786 .Oo Ar n Oc Ns d Ns Ar move-cmd
6789 .Ar n move-cmd Ns s ;
6790 .Ar move-cmd
6791 is a movement command (see above) or
6793 in which case the current line is deleted.
6817 .Oo Ar n Oc Ns y Ns Ar move-cmd
6820 .Ar n move-cmd Ns s
6822 .Ar move-cmd
6825 the whole line is yanked.
6827 Yank from the current position to the end of the line.
6843 .Bl -tag -width Ds
6845 The current line is read, parsed and executed by the shell.
6847 Redraw the current line.
6851 Redo the last edit command
6855 Undo the last edit command.
6857 Undo all changes that have been made to the current line.
6859 They move as expected, both in insert and command mode.
6861 The interrupt and quit terminal characters cause the current line to be
6865 .Bl -tag -width XetcXsuid_profile -compact
6867 User mkshrc profile (non-privileged interactive shells); see
6873 User profile (non-privileged login shells); see
6917 .Xr utf\-8 7 ,
6921 .Pa http://www.mirbsd.org/mksh\-faq.htm
6926 .Pa http://www.mirbsd.org/ksh\-chan.htm
6929 .%B "The KornShell Command and Programming Language"
6933 .%O "ISBN 978\-0\-13\-516972\-8 (0\-13\-516972\-0)"
6938 .%B "The New KornShell Command and Programming Language (2nd Edition)"
6942 .%O "ISBN 978\-0\-13\-182700\-4 (0\-13\-182700\-6)"
6952 .%O "ISBN 978\-0\-672\-32490\-1 (0\-672\-32490\-3)"
6961 .%O "ISBN 978\-1\-55937\-255\-8 (1\-55937\-255\-9)"
6969 .%O "ISBN 978\-1\-56592\-054\-5 (1\-56592\-054\-6)"
6978 .%O "ISBN 978\-0\-596\-00195\-7 (0\-596\-00195\-9)"
6984 .%I "Addison-Wesley Professional"
6986 .%O "ISBN 978\-0\-201\-56324\-5 (0\-201\-56324\-X)"
6989 .An -nosplit
7020 .Nm mksh\-os2
7022 .An KO Myung-Hun Aq Mt [email protected] .
7024 .Nm mksh\-w32
7034 .Pa http://www.mirbsd.org/TaC\-mksh.txt
7041 .\" KO Myung-Hun (mksh for OS/2).
7061 provides a consistent 32-bit integer arithmetic implementation, both
7063 and wraparound defined, even (defying POSIX) on 36-bit and 64-bit systems.
7066 currently uses OPTU-16 internally, which is the same as UTF-8 and CESU-8
7075 .Bd -literal -offset indent
7082 old entries into the new history if their line numbers are
7083 not overwritten by same-number entries from the persistent
7084 history file; truncating the on-disc file to
7088 for the in-memory portion of the history is slow, should use
7094 .\" with vendor patches from insert-your-name-here,
7109 .Aq Mt miros\-[email protected]
7110 (please note the EU-DSGVO/GDPR notice on