| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is a proof of concept on how to easily integrate existing
tests from the tools/regression/ hierarchy into the /usr/tests/ test
suite and on how to adapt them to the new layout for src.
To achieve these goals, this change:
- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.
- Renames the previous regress.sh files to legacy_test.sh.
- Adds Makefiles to build and install the tests and all their supporting
data files into /usr/tests/bin/.
- Plugs the legacy_test test programs into the test suite using the new
TAP backend for Kyua (appearing in 0.8) so that the code of the test
programs does not have to change.
- Registers the new directories in the BSD.test.dist mtree file.
Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)
|
|
|
|
|
| |
An alias should be printed by command -v as a command line; therefore, make
the alias definition suitable for re-input to the shell.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If job control is not enabled, background jobs started with ... & ignore
SIGINT and SIGQUIT so that they are not affected by such signals that are
intended for the foreground job. However, this should not prevent
reassigning a different action for these signals (as if the shell invocation
inherited these signal actions from its parent).
Austin group issue #751
Example:
{ trap - INT; exec sleep 10; } & wait
A Ctrl+C should terminate the sleep command.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This implementation makes minimal changes: command names starting with "-"
(other than "--") can still be queried normally.
|
|
|
|
|
| |
Aliases starting with "-" (which are non-POSIX) will need to be preceded by
an alias not starting with "-" or the newly added "--".
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is required by POSIX, at least for pids that are not known child
processes.
Other problems with job specifications still cause wait to abort with
exit status 2.
PR: 176916
|
|
|
|
|
|
|
|
| |
This is only part of the PR; the behaviour for unknown/invalid pids/jobs
remains unchanged (aborts the builtin with status 2).
PR: 176916
Submitted by: Vadim Goncharov
|
|
|
|
|
|
| |
In most shells (including our sh), break outside a loop does nothing with
status 0, or at least does not abort. Therefore, scripts sometimes (buggily)
depend on this.
|
|
|
|
|
|
|
| |
This test case sometimes fails because of an EINTR-related race condition.
Fixing this race condition likely requires an extra system call per byte,
which would make the read builtin even slower than it already is, or very
complicated trickery. Therefore, remove the test case for now.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
Note: parser/alias10.0 will eat a lot of memory/cpu time when it fails (with
the old sh).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test.
POSIX says that SIGPIPE affects a process and therefore a SIGPIPE caused and
received by a subshell environment may or may not affect the parent shell
environment.
The change assumes that ${SH} is executed in a new process. This must be the
case if it contains a slash and everyone appears to do so anyway even though
POSIX might permit otherwise.
This change makes builtins/wait3.0 work in ksh93.
|
|
|
|
| |
Reported by: lme
|
|
|
|
|
|
| |
In the first command of a 'for', $? should be the exit status of the last
pipeline (command substitution in the word list or command before 'for'),
not always 0.
|
|
|
|
|
|
|
|
|
|
|
| |
Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
o "-e" is set for this shell
o a trap is set on EXIT
o a function returns 1 and causes the script to abort
Reviewed by: jilles
MFC after: 2 weeks
|
|
|
|
|
| |
Reviewed by: jilles
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, rework evalcase() to not evaluate any tree. Instead, return the
NCLISTFALLTHRU node and handle it in evaltree().
Fixed bugs:
* If a ;& list with non-zero exit status is followed by an empty ;; or final
list, the exit status of the case command should be equal to the exit
status of the ;& list, not 0.
* An empty ;& case should not reset $?.
|
|
|
|
|
|
|
| |
* If no pattern is matched, POSIX says the exit status shall be 0 (even if
there are command substitutions).
* If a pattern is matched and there are no command substitutions, the first
command should see the $? from before the case command, not always 0.
|
|
|
|
|
|
|
|
| |
The errno message display added in r222292 did not take attempting to
cd to a non-directory or something that cannot be stat()ed into account.
PR: bin/164070
MFC after: 10 days
|
| |
|
|
|
|
| |
Add some $FreeBSD$ tags so svn will allow the commit.
|
| |
|
|
|
|
| |
These already work properly.
|
|
|
|
|
|
| |
POSIX says the exit status of a for loop without any items shall be 0. There
are no exceptions if the exit status of the previous command was not 0 or if
the item list contains a command substitution with non-zero exit status.
|
|
|
|
| |
This also works on stable/8.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replacing ;; with the new control operator ;& will cause the next list to be
executed as well without checking its pattern, continuing until a list ends
with ;; or until the end of the case statement. This is like omitting
"break" in a C "switch" statement.
The sequence ;& was formerly invalid.
This feature is proposed for the next POSIX issue in Austin Group issue
#449.
|
|
|
|
| |
This ensures the output of these commands is valid shell input.
|
|
|
|
|
| |
Example:
case x in [[:alpha:]]) echo yes ;; esac
|
| |
|
|
|
|
| |
This also passes on stable/8.
|
| |
|
| |
|
|
|
|
|
|
|
| |
CDPATH should be ignored not only for pathnames starting with '/' but also
for pathnames whose first component is '.' or '..'.
The man page already describes this behaviour.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This reflects failure to determine the pathname of the new directory in the
exit status (1). Normally, cd returns successfully if it did chdir() and the
call was successful.
In POSIX, -e only has meaning with -P; because our -L is not entirely
compliant and may fall back to -P mode, -e has some effect with -L as well.
|
|
|
|
|
|
|
|
|
|
| |
?, [...] patterns match codepoints instead of bytes. They do not match
invalid sequences. [...] patterns must not contain invalid sequences
otherwise they will not match anything. This is so that ${var#?} removes the
first codepoint, not the first byte, without putting UTF-8 knowledge into
the ${var#pattern} code. However, * continues to match any string and an
invalid sequence matches an identical invalid sequence. (This differs from
fnmatch(3).)
|
| |
|
|
|
|
|
|
|
| |
Preserving $? may cause problems particularly if set -e is in effect.
It may be useful to preserve the old value of $? in the dot script but this
must not be implemented in such a way that it would break this test.
|