summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Initialize PWD early on (don't expect it to be inherited from theschweikh2006-02-041-0/+2
| | | | | | environment or set it only when changing directories with cd). PR: standards/92640
* s/staticly/statically/gschweikh2006-02-041-2/+2
|
* s/varable/variable/; s/tored/stored/schweikh2006-02-041-2/+2
|
* Remove some white space at EOL.schweikh2006-02-045-15/+15
|
* Document that '#' starts a comment.stefanf2006-01-011-0/+7
| | | | | | | PR: 85103 Submitted by: garys Obtained from: pdksh manual Patch from: Daniel Gerzo (with changes by me)
* o Now when SIG_IGN signal action for SIGCHLD reap zombiesmaxim2005-12-141-0/+2
| | | | | | | | | | | | automatically it is possible wait4(2) returns -1 and sets errno = ECHILD if there were forked children. A user can set such signal handler e.g. via ``trap "" 20'', see a PR for the test case. Deal with this case and mark a job as JOBDONE. PR: bin/90334 Submitted by: bde MFC after: 4 weeks
* [mdoc] add missing space before a punctuation type argument.ru2005-12-131-1/+1
|
* - Document trap's -l option and the behaviour of a missing action or a singlestefanf2005-12-081-2/+14
| | | | | | | | dash. - Discourage the omission of the action. PR: 70985 [1] Submitted by: Martin Kammerhofer
* Print empty quotes ('') when an empty string is passed to outqstr().stefanf2005-12-081-0/+4
| | | | | | | This makes a difference for the trap builtin, where after "trap '' 0" we printed "trap -- quit". This is wrong, because an empty action means to reset the action to the default. A side effect of this commit is that empty variables are now printed as "variable=''" instead of just "variable=".
* Correctly quote the output when showing the installed trap actions.stefanf2005-12-081-6/+5
| | | | | PR: 74043 Submitted by: Jilles Tjoelker
* Clarify that the echo builtin takes an arbitrary number of strings.stefanf2005-12-081-4/+3
| | | | Mention that spaces are printed between the strings.
* Sort.stefanf2005-12-041-6/+6
|
* Remove a few commented out builtins from the original ash. The filesstefanf2005-12-041-5/+0
| | | | implementing them were never part of FreeBSD.
* Add the times builtin. It reports the user and system time for the shellstefanf2005-12-044-1/+34
| | | | | | itself and its children. Instead of calling times() (as implied by POSIX) this implementation directly calls getrusage() to get the times because this is more convenient.
* -mdoc sweep.ru2005-11-175-27/+18
|
* Having three options (-a, -A, -I) controlling the output of dottedru2005-11-163-20/+14
| | | | | | | | | | | files is too much and hard to follow. Instead, make the -I option just mean "do not automatically set -A for root". That is, if -A is explicitly set, -I is ignored. Also, document -I in usage(). (The ls.c diff is better viewed relative to rev. 1.80.) No objection: mux Silence from: mnag MFC after: 3 days
* Mention the non-standardness of the -I option in ls(1).mux2005-11-101-1/+2
| | | | | Spotted by: ru MFC after: 3 days
* Add a -I option to disable the automatic -A flag for the super-user.mux2005-11-102-9/+25
| | | | | | PR: bin/86710 Submitted by: Marcus Alves Grando MFC after: 3 days
* Add `local' and `return' to the list of built-ins.jcamou2005-11-031-0/+8
| | | | | Submitted by: garys Approved by: trhodes (mentor)
* Note which options are not part of the standards.trhodes2005-11-011-1/+12
| | | | | | | Xref locale(1) and bump document date. Reviewed by: keramida No Objections: -standards
* Include disabled options in the output of 'set +o'. POSIX says the output ofstefanf2005-10-291-11/+8
| | | | | | | | | | | | set +o can be used to reload previous settings, for this to work disabled options must be printed as well or otherwise options that were set in the mean time won't be turned off. To avoid an excessively long output line I formatted the output to print only six options per line. Submitted by: Jilles Tjoelker PR: 73500
* Document command -v and -V.stefanf2005-10-291-2/+39
| | | | Glanced at by: simon
* Document that read -t timeout returns 1 if the timeout elapses.stefanf2005-10-291-1/+1
|
* Add the POSIX options -v and -V to the 'command' builtin. Both describe thestefanf2005-10-283-13/+67
| | | | | | | type of their argument, if it is a shell function, an alias, a builtin, etc. -V is more verbose than -v. PR: 77259, 84539
* Protect malloc, realloc and free calls with INT{ON,OFF} directly in chkalloc,stefanf2005-10-283-4/+19
| | | | | | | | | | | | | | ckrealloc and ckfree (added), respectively. sh jumps out of the signal handler using longjmp which is obviously a bad idea during malloc calls. Note: I think there is still a small race here because volatile sig_atomic_t only guarantees atomic reads and writes while we're doing increments and decrements. Protect a setmode call with INT{ON,OFF} as it calls malloc internally. PR: 45478 Patch from: Nate Eldredge
* Use the new name H_SETSIZE instead of the old H_EVENT to set the historystefanf2005-10-191-1/+1
| | | | | | size. PR: 86355
* Give .Dd a tummy rub, forgotten on my last commit.dougb2005-09-301-1/+1
|
* Handle the case where the -P flag is specified for a read-only filedougb2005-09-292-4/+9
| | | | | | | | | | | | | | earlier, and more gracefully. Previously, this combination would be ignored early in the code where permissions are tested and fail later with a very unhelpful "permission denied" error. Instead, test for this flag in the same block that generates the "override?" messages for read-only files, but instead of trying to guess what the user has in mind, generate an error and exit. Update the man page to reflect this new behavior. Not objected to by: freebsd-hackers@
* Bump up BUFSIZE from 4k to 8k. This was requested by portmgr@ to allowmp2005-09-221-0/+1
| | | | | | ports builds in the cluster to work correctly. Tested by: kris
* Add a "-q" quiet flag to kenv so that warnings can be suppressed.rwatson2005-09-132-9/+20
| | | | MFC after: 1 week
* Elaborate on the behaviour of set -e.stefanf2005-09-101-2/+7
|
* Pass the EV_TESTED flag to evalloop() and evalfor(). This fixes unwantedstefanf2005-09-101-8/+8
| | | | | | | | | | | | | | termination with set -e if a command fails in a loop body inside a function with an explicitely tested exit status, eg f() { for i in 1 2 3; do false done } f || true Briefly reviewed by: cracauer
* Pass the EV_TESTED flag to the left operand of NSEMI nodes. This fixesstefanf2005-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | two cases of unwanted termination with set -e: * if-commands containing several commands separated by semicolons, eg if false; false; then [...] * functions with an explicitely tested exit status that contain a failing command which is not the last one, eg f() { false false } f || true PR: 77067, 85267 Briefly reviewed by: cracauer
* Exit the shell if a pipeline that is not preceded by ! fails and set -e isstefanf2005-09-101-3/+7
| | | | | | | active. Use a separate flag to avoid adding another condition to the if-statement at the end of evaltree(). Briefly reviewed by: cracauer
* Split the export synopsis into two lines as -p cannot be mixed with variablestefanf2005-09-091-2/+3
| | | | names.
* - Provide a reasonable error message for `export -p var'.stefanf2005-09-091-1/+3
| | | | - Use argv rather than argptr since getopt() is used here.
* Fix the error message if the mask that is passed to umask -S containsstefanf2005-09-091-1/+1
| | | | non-digits.
* Mention that uuidgen(1) generates DCE version 1 UUIDs onlyrse2005-09-071-2/+3
|
* fix typos: decribed -> described, preceeded -> precededrse2005-09-061-3/+3
|
* Various small code cleanups resulting from a code reviewingrse2005-09-063-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and linting procedure: 1. Remove useless sub-expression: - if (*start || (!ifsspc && start > string && (nulonly || 1))) { + if (*start || (!ifsspc && start > string)) { The sub-expression "(nulonly || 1)" always evaluates to true and according to CVS logs seems to be just a left-over from some debugging and introduced by accident. Removing the sub-expression doesn't change semantics and a code inspection showed that the variable "nulonly" is also not necessary here in any way (and the expression would require fixing instead of removing). 2. Remove dead code: - if (backslash && c == '\\') { - if (read(STDIN_FILENO, &c, 1) != 1) { - status = 1; - break; - } - STPUTC(c, p); - } else if (ap[1] != NULL && strchr(ifs, c) != NULL) { + if (ap[1] != NULL && strchr(ifs, c) != NULL) { Inspection of the control and data flow showed that variable "backslash" is always false (0) when the "if"-expression is evaluated, hence the whole block is effectively dead code. Additionally, the skipping of characters after a backslash is already performed correctly a few lines above, so this code is also not needed at all. According to the CVS logs and the ASH 0.2 sources, this code existed in this way already since its early days. 3. Cleanup Style: - ! trap[signo][0] == '\0' && + ! (trap[signo][0] == '\0') && The expression wants to ensure the trap is not assigned the empty string. But the "!" operator has higher precedence than "==", so the comparison should be put into parenthesis to form the intended way of expression. Nevertheless the code was effectively not really broken as both particular NUL comparisons are semantically equal, of course. But the parenthesized version is a lot more intuitive. 4. Remove shadowing variable declaration: - char *q; The declaration of symbol "q" hides another identical declaration of "q" in the same context. As the other "q" is already reused multiple times and also can be reused again without negative side-effects, just remove the shadowing declaration. 5. Just small cosmetics: - if (ifsset() != 0) + if (ifsset()) The ifsset() macro is already coded by returning the boolean result of a comparison operator, so no need to compare this boolean result again against a numerical value. This also aligns the macros usage to the remaining existing code. Reviewed by: stefanf@
* fix typo: ommitted -> omittedrse2005-09-061-1/+1
|
* Print pointers with %p rather than casting them to long.stefanf2005-09-052-5/+5
|
* Attempt to complete the userspace integration of POSIX.1e extended ACLs.csjp2005-09-054-2/+104
| | | | | | | | | | | | | | This includes adding support for ACLs into cp(1) and mv(1) userspace utilities. For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination operands, the destination file's ACLs shall reflect the source. For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination operands, and -p has been specified, the ACLs from the source shall be preserved on the destination. MFC after: 1 month
* Document that `in word ...' is optional in the for command.stefanf2005-09-031-2/+7
|
* Return 1 from the unalias builtin if _any_ removal fails, not just the laststefanf2005-09-021-1/+1
| | | | one.
* Remove extra getenv() declaration.stefanf2005-09-021-1/+0
|
* Document that unalias can be used to remove several alias names.stefanf2005-09-021-5/+3
|
* Improved descriptions of block size handling.garys2005-08-311-37/+48
| | | | | | | PR: docs/84765 Submitted by: garys Approved by: keramida MFC after: 3 days
* Wrap a line due to a new sentence.jcamou2005-08-291-1/+2
| | | | | Noticed by: simon Approved by: trhodes (mentor)
* o Discuss the ways to escape an alias.jcamou2005-08-291-4/+16
| | | | | | | | | | o Fix the alias syntax lines. o Refer to the Aliases subsection. PR: docs/84914 Submitted by: garys Approved by: trhodes (mentor) MFC after: 3 days
OpenPOWER on IntegriCloud