summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* sh(1): Mention possible ambiguities with $(( and ((.jilles2013-03-241-1/+14
| | | | | | | | | In some other shells, things like $((a);(b)) are command substitutions. Also, there are shells that have an extension ((ARITH)) that evaluates an arithmetic expression and returns status 1 if the result is zero, 0 otherwise. This extension may lead to ambiguity with two subshells starting in sequence.
* Fix compiling ed w/ WITHOUT_ED_CRYPTO... These variables aren'tjmg2013-03-231-3/+1
| | | | | | used.. Submitted by: deeptech71 at gmail dot com
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-212-6/+2
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* sh: Recognize "--" and explicitly reject options in wait builtin.jilles2013-03-151-3/+4
| | | | | | If syntactically invalid job identifiers are to be taken as jobs that exited with status 127, this should not apply to options, so that we can add options later if need be.
* Add a few examples.joel2013-03-157-7/+102
| | | | Obtained from: OpenBSD
* sh: When executing a trap, keep exit status along with evalskip.jilles2013-03-031-2/+3
| | | | | | | This ensures 'return' in a trap returns the correct status to the caller. If evalskip is not set or if it is overridden by a previous evalskip, keep the old behaviour of restoring the exit status from before the trap.
* Enhance test(1) by adding provision to compare any combination of thepeterj2013-02-252-27/+215
| | | | | | | | | access, birth, change and modify times of two files, instead of only being able to compare modify times. The builtin test in sh(1) will automagically acquire the same expansion. Approved by: grog MFC after: 2 weeks
* sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.jilles2013-02-235-20/+23
|
* sh: Fix a crash with the stackmark code.jilles2013-02-191-0/+2
| | | | | | | | | | | | | | | | If a stack mark is set while the current stack block is empty, the stack block may move later on (because of realloc()) and the stack mark needs to be updated. This updating does not happen after popstackmark() has been called; therefore, call setstackmark() again if the stack mark is still being used. For some reason, this only affects a few users. I cannot reproduce it. The situation seems quite rare as well because an empty stack block would usually be freed (by popstackmark()) before execution reaches a setstackmark() call. PR: 175922 Tested by: KT Sin
* Fix NFSv4 permission description in setfacl(1) manual page: the 'D'trasz2013-02-081-2/+2
| | | | | | means delete_child, not delete. MFC after: 1 week
* Improve description of the "-m" option to setfacl(1).trasz2013-02-081-5/+6
| | | | | Submitted by: scottl MFC after: 1 week
* In the setfacl(1) manual page, make it clear that for NFSv4 ACLs,trasz2013-02-081-1/+6
| | | | | | one should really use -a and -x instead of -m. MFC after: 1 week
* sh: Simplify mksyntax and make it fit for cross-compiling.jilles2013-02-071-88/+66
| | | | | | | | | | | | | | | | | | | | Now it outputs fixed files, which use constants provided by the C standard library to determine appropriate values for the target machine. Before, mksyntax inspected the host machine which resulted in subtle breakage if e.g. char is signed on the host and unsigned on the target such as when cross-compiling on x86 for ARM. Tested using -funsigned-char on amd64. Compiling build-tools without it and sh itself with it causes various tests to fail without this change but not with this change. With consistent -funsigned-char, tests pass with or without this change. The mksyntax program could be removed and syntax.c and syntax.h committed to the repository. Submitted by: Christoph Mallon MFC after: 2 weeks
* sh: Fix a comment.jilles2013-02-071-1/+1
|
* Catch TRACE parameters up with r238888. This change is only needed whendelphij2013-02-071-1/+1
| | | | debugging is enabled.
* Document P_PPTRACE.kib2013-02-071-1/+2
| | | | MFC after: 2 weeks
* sh: Do not test for digit_contig in mksyntax.jilles2013-02-051-46/+2
| | | | | | | | | ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters 0123456789 are contiguous. The generated syntax.c and syntax.h remain the same. Submitted by: Christoph Mallon
* sh: Expand here documents in the current process.jilles2013-02-035-24/+48
| | | | | | | | | | | | | | | | | Expand here documents at the same point other redirections are expanded but use a non-fork subshell environment (like simple command substitutions) for compatibility. Substitition errors result in an empty here document like before. As a result, a fork is avoided for short (<4K) expanded here documents. Unexpanded here documents (with quoted end marker after <<) are not affected by this change. They already only forked when >4K. Side effects: * Order of expansion is slightly different. * Slow expansions are not executed in parallel with the redirected command. * A non-fork subshell environment is subtly different from a forked process.
* sh: Prefer our character classification functions to <ctype.h>.jilles2013-01-312-3/+2
|
* sh: Show negated commands (!) in jobs output.jilles2013-01-311-0/+4
|
* Fix date.joel2013-01-291-1/+1
|
* Add -l option to cat(1). This option causes cat(1) to use fcntl(2) tobrooks2013-01-292-6/+30
| | | | | | | | set an exclusive advisory lock on stdout. This will be used to guarantee orderly writing to METALOG. Sponsored by: DARPA, AFRL Obtained from: NetBSD (mason)
* Return with an error from copy_link(), copy_fifo() and copy_special() ifmarkj2013-01-271-0/+17
| | | | | | | | the -n option is specified and the destination file exists. PR: bin/174489 Approved by: rstone (co-mentor) MFC after: 2 weeks
* Don't time travel back and use a present date.delphij2013-01-251-1/+1
| | | | Noticed by: mckusick
* - Wrap long line;delphij2013-01-242-2/+4
| | | | | | - Add -, to SYNOPSIS section. MFC after: 2 weeks
* Return "failure" as we do for 'cp -i' and a "n" answer.obrien2013-01-231-1/+1
| | | | | | Otherwise with '-v' we print out the file name as if it was copied: /tmp/2gb-card/M0132.CTG not overwritten /mnt/DCIM/CANONMSC/M0132.CTG -> /tmp/2gb-card/M0132.CTG
* Add FILES section.joel2013-01-221-2/+14
| | | | Discussed with: jilles
* Change the $ENV example to use .shrc instead of .shinit. This is consistentjoel2013-01-201-3/+3
| | | | | | with what we use in /usr/share/skel/dot.profile. Discussed with: jilles
* sh: Move some stackmarks to fix high memory usage in some loops.jilles2013-01-201-11/+5
| | | | | | | | | | | | If a loop contained certain commands (such as redirected compound commands), the temporary memory for the redirection was not freed between iterations of the loop but only after the loop. Put a stackmark in evaltree(), freeing memory whenever a node has been evaluated. Some other stackmarks are then redundant; remove them. Example: while :; do { :; } </dev/null; done
* sh: Remove mkinit's initialization routine.jilles2013-01-205-35/+12
| | | | Instead, call the only init function left directly from main().
* sh: Replace an mkinit use with an initialization.jilles2013-01-191-10/+5
|
* - Move 'showthreads' check out of fmt.c.jhb2013-01-192-2/+2
| | | | | - Update shadow copy of fmt_argv() prototype in w.c and fix calls for additional parameter.
* Include the thread name along with the command name when displaying thejhb2013-01-183-10/+16
| | | | | | | | | command name of a thread from a multi-threaded process that doesn't have an available argument list (such as kernel processes) and threads display is enabled via -H. Reviewed by: alfred, delphij, eric@vangyzen.net MFC after: 1 week
* Remove useless variable 'Pflag':eadler2013-01-171-7/+5
| | | | | | | -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva MFC after: 3 days
* Use a different way to silence clang analyzer as done in r245494 bydelphij2013-01-161-2/+1
| | | | | | explicitly telling the compiler that we are on the exit route. X-MFC: together with r245494
* Free memory before exiting in order to silence a warning from the clangeadler2013-01-161-0/+1
| | | | | | | static analyzer Approved by: cperciva MFC after: 3 days
* sh: Simplify cd-hash interaction.jilles2013-01-142-40/+15
| | | | | | | | Instead of rechecking relative paths for all hashed utilities after a cd, track if any utility in cmdtable depends on a relative path in PATH. If there is such a utility, cd clears the entire table. As a result, the '*' in hash no longer happens.
* sh: Pass $? to command substitution containing compound/multiple commands.jilles2013-01-141-2/+1
| | | | | Example: false; echo $(echo $?; :)
* sh: Fix crash when parsing '{ } &'.jilles2013-01-131-2/+2
| | | | MFC after: 1 week
* sh: Don't lose $? when backquoted command ends with semicolon or newline.jilles2013-01-131-1/+2
| | | | | | | | | An empty simple command was added and overwrote the exit status with 0. This affects `...` but not $(...). Example: v=`false;`; echo $?
* When WCHAR_MIN == 0 the check if a wchar_t value will always be true. Inandrew2013-01-061-1/+4
| | | | this case skip the test as gcc complains it is always true.
* Fix wording nit.gjb2012-12-281-1/+1
| | | | | | PR: 174787 Submitted by: Cody Rank MFC after: 3 days
* test(1): Document == alias for =.jilles2012-12-271-1/+8
| | | | | | Reviewed by: gjb Requested by: gjb MFC after: 1 week
* sh: Prefer strsignal() to accessing sys_siglist directly.jilles2012-12-251-8/+13
| | | | | | | | Accessing sys_siglist directly requires rtld to copy it from libc to the sh executable's BSS. Also, strsignal() will put in the signal number for unknown signals (FreeBSD-specific) so we need not do that ourselves. Unfortunately, there is no function for sys_signame.
* Fix socket calls on error post-r243965.kevlo2012-12-211-1/+1
| | | | Submitted by: Garrett Cooper
* sh: Detect and flag write errors on stdout in builtins.jilles2012-12-123-0/+22
| | | | | | | If there is a write error on stdout, a message will be printed (to stderr) and the exit status will be changed to 2 if it would have been 0 or 1. PR: bin/158206
* Use kern.max_pid sysctl to obtain maximum PID number instead of using localpjd2012-12-121-3/+17
| | | | | | define. Reviewed by: jhb
* Handle large negative block counts correctly.grog2012-12-121-1/+1
| | | | MFC after: 2 weeks
* Update man pages and clarify a number of options.grog2012-11-162-35/+65
| | | | | | Rework block count calculations to work correctly with small "block" sizes. MFC after: 14 days
* Fix section number for pstat and swapinfo cross references.pluknet2012-11-151-3/+3
| | | | MFC after: 3 days
OpenPOWER on IntegriCloud