| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
The manual page documents "\$" to expand to either "$" or "#" followed by
a single space. In reality, the single space character is not appended.
PR: 247791
Submitted by: kd-dev@pm.me
MFC after: 7 days
Notes:
svn path=/head/; revision=362957
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pipefail option allows checking the exit status of all commands in a
pipeline more easily, at a limited cost of complexity in sh itself. It works
similarly to the option in bash, ksh93 and mksh.
Like ksh93 and unlike bash and mksh, the state of the option is saved when a
pipeline is started. Therefore, even in the case of commands like
A | B &
a later change of the option does not change the exit status, the same way
(A | B) &
works.
Since SIGPIPE is not handled specially, more work in the script is required
for a proper exit status for pipelines containing commands such as head that
may terminate successfully without reading all input. This can be something
like
(
cmd1
r=$?
if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then
exit 0
else
exit "$r"
fi
) | head
PR: 224270
Relnotes: yes
Notes:
svn path=/head/; revision=344502
|
| |
|
|
|
|
|
|
|
|
|
|
| |
shell startup.
Reviewed by: 0mp (man page), jilles
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18790
Notes:
svn path=/head/; revision=343399
|
| |
|
|
|
|
|
|
|
| |
Altering the -c string at run time does not make sense and is not possible.
MFC after: 1 week
Notes:
svn path=/head/; revision=341725
|
| |
|
|
|
|
|
|
|
|
| |
This affects scripts named on the command line, named with a '.' special
builtin and found via the PATH %func autoloading mechanism.
PR: 231986
Notes:
svn path=/head/; revision=341097
|
| |
|
|
|
|
|
|
|
|
|
| |
While here, pet mandoc.
Reviewed by: eadler (previous revision), jilles (previous revision), mat (mentor)
Approved by: manpages (jilles), mat (mentor)
Differential Revision: https://reviews.freebsd.org/D15609
Notes:
svn path=/head/; revision=336483
|
| |
|
|
| |
Notes:
svn path=/head/; revision=327121
|
| |
|
|
|
|
|
|
|
|
|
| |
Many style-level issues are still reported.
Submitted by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: jilles (previous revision)
Differential Revision: https://reviews.freebsd.org/D13334
Notes:
svn path=/head/; revision=326651
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If CDPATH is used non-trivially or the operand is "-", cd writes the
directory actually switched to. (We currently do this only in interactive
shells, but POSIX requires this in non-interactive shells as well.)
As mentioned in Austin group bug #1045, cd shall not return an error while
leaving the current directory changed. Therefore, ignore any write error.
Notes:
svn path=/head/; revision=320340
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.
Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96
Notes:
svn path=/head/; revision=314436
|
| |
|
|
|
|
|
|
| |
Reported by: make manlint
MFC after: 2 days
Notes:
svn path=/head/; revision=313660
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per Austin group issue #884, always set IFS to $' \t\n'. As before, IFS will
be exported iff it was in the environment.
Most shells (e.g. bash, ksh93 and mksh) already did this. This change
improves predictability, in that scripts can simply rely on the default
value.
However, the effect on security is little, since applications should not be
calling the shell with attacker-controlled environment variable names in the
first place and other security-sensitive variables such as PATH should be
and are imported by the shell.
When using a new sh with an old (before 10.2) libc wordexp(), IFS is no
longer passed on. Otherwise, wordexp() continues to pass along IFS from the
environment per its documentation.
Discussed with: pfg
Relnotes: yes
Notes:
svn path=/head/; revision=306843
|
| |
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=301007
|
| |
|
|
|
|
|
|
|
|
| |
They were swapped.
X-Confirmed by: jilles
MFC after: 1 week
Notes:
svn path=/head/; revision=300642
|
| |
|
|
|
|
|
|
|
|
|
| |
login.conf(5) support.
Reviewed by: jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D5610
Notes:
svn path=/head/; revision=296723
|
| |
|
|
|
|
|
|
| |
This reflects the changes in r294649 and can therefore not be MFCed by
itself.
Notes:
svn path=/head/; revision=295083
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX requires this to prevent entering function definitions in history but
this implementation does nothing except retain the option's value. In ksh88,
function definitions were usually entered in the history file, even when
they came from ~/.profile and the $ENV file, to allow displaying their
definitions.
This is also the first option that does not have a letter.
Notes:
svn path=/head/; revision=287296
|
| |
|
|
| |
Notes:
svn path=/head/; revision=285385
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
n n...'.
The parser considered 'trap exit INT' to reset the default for both EXIT and
INT. This beahvior is not POSIX compliant. This was avoided if a value was
specified for 'exit', but then disallows exiting with the signal received. A
possible workaround is using ' exit'.
However POSIX does allow this type of behavior if the parameters are all
integers. Fix the handling for this and clarify its support in the manpage
since it is specifically allowed by POSIX.
Differential Revision: https://reviews.freebsd.org/D2325
Reviewed by: jilles
MFC after: 2 weeks
Notes:
svn path=/head/; revision=281718
|
| |
|
|
| |
Notes:
svn path=/head/; revision=279188
|
| |
|
|
| |
Notes:
svn path=/head/; revision=274515
|
| |
|
|
|
|
|
|
|
| |
Per Austin Group issue #459, shifting zero positional parameters may or may
not be considered an operand error (which causes the shell to exit in most
cases).
Notes:
svn path=/head/; revision=274254
|
| |
|
|
|
|
|
|
| |
PR: 193759
MFC after: 1 week
Notes:
svn path=/head/; revision=271936
|
| |
|
|
|
|
|
|
| |
If no tty is available, 'set -m' is still useful to put jobs in their own
process groups.
Notes:
svn path=/head/; revision=271144
|
| |
|
|
|
|
|
|
| |
Reviewed by: jilles
MFC after: soon
Notes:
svn path=/head/; revision=262467
|
| |
|
|
|
|
|
|
|
|
|
| |
If an alias's value ends with a space or tab, the next word is also
checked for aliases.
This is a POSIX feature. It is useful with utilities like command and
nohup (alias them to themselves followed by a space).
Notes:
svn path=/head/; revision=261192
|
| |
|
|
|
|
|
|
| |
Also, do not say that ! before a pipeline is an operator, because it is
syntactically a keyword.
Notes:
svn path=/head/; revision=260246
|
| |
|
|
| |
Notes:
svn path=/head/; revision=257506
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Formerly, return always returned from a function if it was called from a
function, even if there was a closer dot script. This was for compatibility
with the Bourne shell which only allowed returning from functions.
Other modern shells and POSIX return from the function or the dot script,
whichever is closest.
Git 1.8.4's rebase --continue depends on the POSIX behaviour.
Reported by: Christoph Mallon, avg
Notes:
svn path=/head/; revision=255215
|
| |
|
|
|
|
|
|
|
| |
This has always been the case and is intended (just like cd).
This matches Austin group issue #706.
Notes:
svn path=/head/; revision=251763
|
| |
|
|
|
|
|
| |
PR: 176916
Notes:
svn path=/head/; revision=251432
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* If read -t times out, return status as if interrupted by SIGALRM
(formerly 1).
* If a trapped signal interrupts read, return status 128+sig (formerly 1).
* If [EINTR] occurs but there is no trap, retry the read (for example
because of a SIGWINCH in interactive mode).
* If a read error occurs, write an error message and return status 2.
As before, a variable assignment error returns 2 and discards the remaining
data read.
Notes:
svn path=/head/; revision=250214
|
| |
|
|
|
|
|
|
|
| |
PR: 173410
Submitted by: Derek Wood <ddwood@outlook.com>
Reviewed by: jilles
Notes:
svn path=/head/; revision=249740
|
| |
|
|
| |
Notes:
svn path=/head/; revision=248870
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=248692
|
| |
|
|
|
|
|
| |
Discussed with: jilles
Notes:
svn path=/head/; revision=245805
|
| |
|
|
|
|
|
|
|
| |
with what we use in /usr/share/skel/dot.profile.
Discussed with: jilles
Notes:
svn path=/head/; revision=245699
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=245426
|
| |
|
|
|
|
|
|
|
| |
Fixes a mandoc lint warning.
Discussed with: brueffer, Jason McIntyre <jmc@kerhand.co.uk>
Notes:
svn path=/head/; revision=241544
|
| |
|
|
| |
Notes:
svn path=/head/; revision=240369
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Examples:
export x=~
now expands the tilde
local y=$1
is now safe, even if $1 contains IFS characters or metacharacters.
For a word to "look like an assignment", it must start with a name followed
by an equals sign, none of which may be quoted.
The special treatment applies when the first word (potentially after
"command") is "export", "readonly" or "local". There may be quoting
characters but no expansions. If "local" is overridden with a function there
is no special treatment ("export" and "readonly" cannot be overridden with a
function).
If things like
local arr=(1 2 3)
are ever allowed in the future, they cannot call a "local" function. This
would either be a run-time error or it would call the builtin.
This matches Austin Group bug #351, planned for the next issue of POSIX.1.
PR: bin/166771
Notes:
svn path=/head/; revision=238468
|
| |
|
|
| |
Notes:
svn path=/head/; revision=235400
|
| |
|
|
|
|
|
|
|
|
| |
quotation. Also make sure we have the same amount of columns in each row as
the number of columns we specify in the head arguments.
Reviewed by: brueffer
Notes:
svn path=/head/; revision=233992
|
| |
|
|
|
|
|
|
|
|
| |
Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days
Notes:
svn path=/head/; revision=233648
|
| |
|
|
| |
Notes:
svn path=/head/; revision=233457
|
| |
|
|
| |
Notes:
svn path=/head/; revision=227122
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because sh executes commands in subshell environments without forking in
more and more cases (particularly from 8.0 on), it makes sense to describe
subshell environments more precisely using ideas from POSIX, together with
some FreeBSD-specific items.
In particular, the hash and times builtins may not behave as if their state
is copied for a subshell environment while leaving the parent shell
environment unchanged.
Notes:
svn path=/head/; revision=223909
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Shell patterns are also for ${var#pat} and the like.
* An '!' by itself will not trigger pathname generation so do not call it a
meta-character, even though it has a special meaning directly after an
'['.
* Character ranges are locale-dependent.
* A '^' will complement a character class like '!' but is non-standard.
MFC after: 1 week
Notes:
svn path=/head/; revision=223522
|
| |
|
|
|
|
|
|
| |
Suggested by: netchild
Reviewed by: gjb
Notes:
svn path=/head/; revision=223517
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX requires a -h option to sh and set, to locate and remember utilities
invoked by functions as they are defined. Given that this
locate-and-remember process is optional elsewhere, it seems safe enough to
make this option do nothing.
POSIX does not specify a long name for this option. Follow ksh in calling it
"trackall".
Notes:
svn path=/head/; revision=223281
|