summaryrefslogtreecommitdiff
path: root/bin/ksh/ksh.1
AgeCommit message (Collapse)Author
2024-09-25remove some unneeded Xo/Xc calls; from evan silbermanJason McIntyre
the original diff had a couple of errors, which i've fixed
2023-10-20Improve markup in some cases where .Li was abused.Ingo Schwarze
Triggered by a smaller diff from jan@. OK jmc@ jan@
2023-06-10ksh: remove broken special handling of test -tOmar Polo
Drop the vestiges of the pre-POSIX support of `test -t' defaulting to fd 1. It doesn't work and it always succeed since "-t" is treated as a string by default when no argument (fd) is specified. diff by Lucas (lucas [at] sexy [dot] is) with minor change by me. ok millert@
2022-12-26reformat some multiline markup, which had been causing an unwantedJason McIntyre
space (specifically in the "alias", "readonly" and "typeset" commands); from josiah frentsos
2022-09-13== in [[ does pattern matching as wellKlemens Nanni
OK millert
2022-03-31man pages: add missing commas between subordinate and main clausesChristian Weisgerber
jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@
2021-05-04shell scripts should use getopts instead of getoptChristian Weisgerber
Add a prominent deprecation notice to getopt.1. Add examples of the getopts idiom to sh.1 and ksh.1. Requested by and ok espie@, ok jmc@
2021-03-11groff complains about the word "An" in an Rs/Re block, believing it a macro,Jason McIntyre
so escape it;
2021-03-10Add support for ^R (redraw) in insert mode too.Todd C. Miller
From gotroyb127, OK tb@
2021-03-08use a journal reference instead of cstr when possibleJonathan Gray
2021-03-08Add some references, most of these were removed when we stopped buildingJonathan Gray
and installing USD/SMM/PSD docs. jmc@ agrees with the direction, ok millert@ on an earlier diff
2020-09-20Clear screen before redrawing the line with ^L, also in input mode.Todd C. Miller
This is similar to the emacs mode clear-screen command. Unlike bash, but like zsh, ^L also works in input mode, not just command mode. OK kn@ tb@
2020-07-07Add support for set -o pipefailJeremie Courreges-Anglas
With the pipefail option set, the exit status of a pipeline is 0 if all commands succeed, or the return status of the rightmost command that fails. This can help stronger error checking, but is not a silver bullet. For example, commands will exhibit a non-zero exit status if they're killed by a SIGPIPE when writing to a pipe. Yet pipefail was considered useful enough to be included in the next POSIX standard. This implementation remembers the value of the pipefail option when a pipeline is started, as described as option 1) in https://www.austingroupbugs.net/view.php?id=789#c4102 Requested by ajacoutot@, ok millert@
2019-11-26some corrections to CDPATH;Jason McIntyre
from chohag
2019-06-24Fix spellingJeremie Courreges-Anglas
2019-06-24Partial revert of rev. 1.151:Ingo Schwarze
Reference the First Edition (1989) of Bolsky/Korn which is about ksh88, the shell the OpenBSD ksh(1) descends from (via pdksh). The Second Edition (1995) of the book is about ksh93 which we don't provide. Pointed out by Andras Farkas on bugs@.
2019-06-21zap trailing whitespace;Jason McIntyre
2019-06-19Allow string greater/less than than operators to work with test aka [.Todd C. Miller
Previously they were only recognized in [[ ... ]] expressions. This changes sh/ksh to be consistent with test(1) as well as shells like bash and dash. OK jca@ jmc@
2019-04-03Bind ^L (C-l) to clear-screen instead of redrawJeremie Courreges-Anglas
Slightly more useful for some, same defaults as bash. No objection deraadt@ phessler@, ok tb@ kn@ benno@
2018-12-16Tweak the syntax displays to show that the list of wordsIngo Schwarze
in "for name in [word ...]; do list; done" can be empty. In sh(1), clarify what happens in that case. In ksh(1), clarify how it can happen that the list is never executed. OK jmc@ tb@
2018-06-18Add clear-screen emacs editing command, currently not bound to aTodd C. Miller
key by default. The shell will query the terminfo database to find the escape sequence to clear the screen. OK deraadt@
2018-05-30point readers to the correct place instead of having themSebastian Benoit
jump around. suggested and ok jmc@, ok jcm@
2018-05-18remove the alias type='whence -v' and replace it withSebastian Benoit
a buildin command, that just calls into c_whence(). This makes type look like the buildin in other shells and makes things like system("'type' 'git'"); work. With lots of suggestions and feedback from anton@, kn@ and jca@. ok kn@ jca@
2018-02-06Clarify that the "bind" built-in command only affects Emacs editingIngo Schwarze
mode, to avoid potential confusion pointed out by andreas dot kahari at icm dot uu dot se on misc@. Patch minimally tweaked based on a comment from jmc@. OK anton@ jca@ jmc@ on the previous version without the tweak.
2017-12-12Document change in the default shell prompts.Theo Buehler
Discussed with and ok jmc
2017-11-22Fix some incorrectness related to Emacs editing mode in ksh:anton
- Keep the order of bindings in sync between the manual and implementation - Fix wrongly documented bindings in the manual - Break out commands without a default binding in the manual ok jmc@ tb@
2017-08-30Implement HISTCONTROL ignoredups & ignorespace featuresJeremie Courreges-Anglas
ignoredups: don't save the current line if it is identical to the last history line. ignorespace: don't save the current line if it starts with a space ok anton@ millert@
2017-08-30Stop exposing the emacs-usemeta option, and warn when trying to set it.Jeremie Courreges-Anglas
Unused since 2012, to be removed after 6.2. Input from anton@, ok anton@ millert@
2017-08-19\$ in PS1 gets you the default prompt character, which differs from theJason McIntyre
default prompt by not including a space after the character; diff from scott cheloha
2017-08-11Retire old behavior of requiring root prompt to contain # or \!Philip Guenther
Requested by akoshibe and phessler ok phessler@ anton@ jca@
2017-07-06fix broken cross references; found with mandoc -TlintIngo Schwarze
2017-07-04Backout previous due to a bug discovered by zhuk@ that requires some tinkeringanton
and is not an easy fix for now.
2017-07-04Add support for pattern substitution to variables in ksh using a common syntaxanton
borrowed from ksh93. Survived a ports build performed by naddy@ and encouraged by many.
2017-06-20'^T' is documented to be bounded to transpose-chars while in emacsBryan Steele
mode, not "stuff". While here, remove the poorly described "stuff" and "stuff" bind functions as well.. In the unlikely event anyone has those in .kshrc, they'll need to be removed. ok anton@
2017-02-19Assigning to RANDOM calls srand_deterministic(3), not srand(3),Ingo Schwarze
and simplify the next sentence; triggered by a different patch from Anton dot Lindqvist at gmail dot com. OK millert@ tb@
2016-11-14Markup improvements:Ingo Schwarze
1. Mark up reserved words intended to appear at the beginning of command lines with .Ic. 2. Mark up syntax elements intended to appear in the middle of command lines with .Cm. This is not only more systematic, but also makes internal search commands like :tif<enter>, :tstop<enter>, and :t[[<enter> work in man(1).
2016-10-15remove the "in the future" notes from the past;Jason McIntyre
from ray lai
2016-10-14Correct description of the "bind" builtin command.Ingo Schwarze
jmc@ finds the key binding stuff "disgusting" (i can't argue with that) and doesn't want to comment on the content, but agrees with the wording.
2016-10-07note that ulimit -m is not enforced, spotted by jmcTed Unangst
2016-09-30remove unneccessary .Pp; from jan staryJason McIntyre
2016-09-27Move bug description to the BUGS sectionDmitrij Czarkoff
OK natano@, jmc@ (I forgot to commit it back in mid-August when it was discussed.)
2016-09-04Allow simple custom completions by creating an array namedNicholas Marriott
"complete_commandname_argnum", for example: set -A complete_kill_1 -- -9 -HUP -INFO -KILL -TERM To set completions for the first argument to kill(1). If no complete_* arrays are present, the normal filename completion is offered. positive comments from many; man page ok/tweaks jmc; ok tedu
2016-04-27Do not handle echo "`echo \"hi\"`" in POSIX mode differently than inChristian Weisgerber
traditional mode. This aligns ksh's behavior with bash and FreeBSD sh. The interpretation of the POSIX text is disputed, but it is unlikely that a change from the traditional behavior was intended. ok millert@
2016-03-21More ksh POSIX compliance fixes by Martijn Dekker:tb
This simple patch makes the 'command' builtin POSIX-compliant and consistent with other current shells. It fixes two things: a) 'command -v' does not find shell reserved words (a.k.a. keywords). For instance, 'command -v select' outputs nothing but should output 'select'. b) 'command -pv' always outputs the path of an external command, even if 'command -p' would execute a builtin. For instance, 'command -p kill' executes the 'kill' builtin, as expected, but 'command -pv kill' outputs '/bin/kill'. The '-v' option is supposed to reflect what would actually be executed, so 'command -pv kill' should output 'kill'. The -p option sets the PATH to a default system value before doing the search, but that has no bearing on the fact that builtins take precedence over external commands. The patch fixes both issues for 'command' without affecting the behaviour of the ksh-specific builtin 'whence', which is handled by the same C function. Regression test added to obsd-regress.t. Issues found and fixed by Martijn Dekker, ok millert@
2016-03-06tweak previous a little;Jason McIntyre
2016-03-06Make set +o conform with POSIX.natano
It should be possible to use set +o to save the current shell options, then modify them at will and later restore them to the saved value. Therefore the output must not only contain the options which are currently set, but also the ones that are _not_ set, so a restore disables them if they are enabled. from Martijn Dekker (martijn (at) inlv (dot) org) ok sthen@, tb@
2016-03-04Fix a typo. The command is to get the default system PATH valueTodd C. Miller
is "getconf PATH" not "getconf CS_PATH".
2016-03-04remove CSRG BSD-licensed mknod builtin code which was previously used toTheo de Raadt
accelerate install/upgrade time MAKEDEV runs. That allows ramdisk ksh to be pledged, without needing "dpath". We'll solve the performance issues a different way (soon). ok otto espie natano tb tobiasu rpe
2015-12-29Remove reference to $ERRNO, which was been unimplemented for >= 19mmcc
years. From Michael Reed. ok halex@
2015-12-26remove special characters; diff from michael reedJason McIntyre