#
d1e99272 |
| 06-Oct-1996 |
Steve Price <steve@FreeBSD.org> |
Fix a problem with sh that conflicts with the -e flag text in the man page. Now this will work correctly:
/bin/sh -ec 'false && true; echo hi'
Obtained from: VaX#n8 <vax@linkdead.paranoia.com>
|
Revision tags: release/2.1.5_cvs |
|
#
aa9caaf6 |
| 01-Sep-1996 |
Peter Wemm <peter@FreeBSD.org> |
Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a merge of parallel duplicate work by Steve Price and myself. :-]
There are some changes to the build that are my fault... mkini
Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a merge of parallel duplicate work by Steve Price and myself. :-]
There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes.
This closes a pile of /bin/sh PR's, but not all of them..
Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
show more ...
|
#
069428af |
| 27-May-1996 |
Peter Wemm <peter@FreeBSD.org> |
Import the 4.4BSD-Lite2 /bin/sh sources
Requested by: joerg
(Note, this is mostly going to be conflicts, which is expected. Our entire sh source has a mainline, so this should not change anything
Import the 4.4BSD-Lite2 /bin/sh sources
Requested by: joerg
(Note, this is mostly going to be conflicts, which is expected. Our entire sh source has a mainline, so this should not change anything except for a few new files appearing. I dont think they are a problem)
show more ...
|
Revision tags: release/2.1.0_cvs |
|
#
a9e0f8b2 |
| 20-Sep-1995 |
David Greenman <dg@FreeBSD.org> |
Don't dereference a NULL pointer in the case of a null pipe. e.g.: ls |> foo.out
sh now behaves the same as it does under SunOS 4.x for this case.
|
Revision tags: release/2.0.5_cvs |
|
#
2162b2d2 |
| 30-May-1995 |
Rodney W. Grimes <rgrimes@FreeBSD.org> |
Remove trailing whitespace.
Reviewed by: phk
|
Revision tags: release/2.0 |
|
#
89730b29 |
| 24-Sep-1994 |
David Greenman <dg@FreeBSD.org> |
Added $Id$
|
Revision tags: release/1.1.5.1_cvs |
|
#
4b88c807 |
| 26-May-1994 |
Rodney W. Grimes <rgrimes@FreeBSD.org> |
BSD 4.4 Lite bin Sources
|
Revision tags: release/7.3.0_cvs, release/7.3.0 |
|
#
c3bb8589 |
| 14-Mar-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Do not abort on a redirection error on a compound command.
Redirection errors on subshells already did not abort the shell because the redirection is executed in the subshell.
Other shells seem
sh: Do not abort on a redirection error on a compound command.
Redirection errors on subshells already did not abort the shell because the redirection is executed in the subshell.
Other shells seem to agree that these redirection errors should not abort the shell.
Also ensure that the redirections will be cleaned up properly in cases like command eval '{ shift x; } 2>/dev/null'
Example: { echo bad; } </var/empty/x; echo good
show more ...
|
#
3a64dbc2 |
| 13-Mar-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Do not abort on a redirection error if there is no command word.
Although simple commands without a command word (only assignments and/or redirections) are much like special builtins, POSIX and
sh: Do not abort on a redirection error if there is no command word.
Although simple commands without a command word (only assignments and/or redirections) are much like special builtins, POSIX and most shells seem to agree that redirection errors should not abort the shell in this case. Of course, the assignments persist and assignment errors are fatal.
To get the old behaviour portably, use the ':' special builtin. To get the new behaviour portably, given that there are no assignments, use the 'true' regular builtin.
show more ...
|
#
17490974 |
| 06-Mar-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Make sure to popredir() even if a function caused an error.
|
#
544754df |
| 06-Mar-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Make sure to popredir() even if a special builtin caused an error.
|
#
c848bc18 |
| 06-Mar-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Improve the command builtin: * avoid unnecessary fork * allow executing builtins via command * executing a special builtin via command removes its special properties
Obtained from: NetBSD (parts)
|
#
9199c09a |
| 06-Jan-2010 |
Warner Losh <imp@FreeBSD.org> |
Merge from head at r201628.
# This hasn't been tested, and there are at least three bad commits # that need to be backed out before the branch will be stable again.
|
#
dc82a6f6 |
| 03-Jan-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Send the "not found" message for builtin <cmd> to redirected fd 2.
|
#
f7cc73af |
| 01-Jan-2010 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Fix some bugs with backquoted builtins: - correctly handle error output in $(builtin 2>&1), clarify out1/out2 vs output/errout in the code - treat all builtins as regular builtins so errors do
sh: Fix some bugs with backquoted builtins: - correctly handle error output in $(builtin 2>&1), clarify out1/out2 vs output/errout in the code - treat all builtins as regular builtins so errors do not abort the shell and variable assignments do not persist - respect the caller's INTOFF
Some bugs still exist: - expansion errors may still abort the shell - some side effects of expansions and builtins persist
show more ...
|
#
06a8a57f |
| 31-Dec-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Allow command -pv and command -pV (lookup using _PATH_STDPATH).
|
#
92004afe |
| 30-Dec-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Ensure funcnest is decremented if there was an error in the function.
This will be important when things like 'command eval f' will be possible. Currently, the funcnest = 0 assignment in RESET (
sh: Ensure funcnest is decremented if there was an error in the function.
This will be important when things like 'command eval f' will be possible. Currently, the funcnest = 0 assignment in RESET (called when returning to the top level after an error in interactive mode) is really sufficient.
show more ...
|
#
384aedab |
| 27-Dec-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Various warning fixes (from WARNS=6 NO_WERROR=1): - const - initializations to silence -Wuninitialized (it was safe anyway) - remove nested extern declarations - rename "index" locals to "idx"
|
#
e1ef3141 |
| 29-Nov-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
Fix some cases where file descriptors from redirections leak to programs.
- Redirecting fds that were not open before kept two copies of the redirected file. sh -c '{ :; } 7>/dev/null; fstat -
Fix some cases where file descriptors from redirections leak to programs.
- Redirecting fds that were not open before kept two copies of the redirected file. sh -c '{ :; } 7>/dev/null; fstat -p $$; true' (both fd 7 and 10 remained open) - File descriptors used to restore things after redirection were not set close-on-exec, instead they were explicitly closed before executing a program normally and before executing a shell procedure. The latter must remain but the former is replaced by close-on-exec. sh -c 'exec 7</; { exec fstat -p $$; } 7>/dev/null; true' (fd 10 remained open)
The examples above are simpler than the testsuite because I do not want to use fstat or procstat in the testsuite.
show more ...
|
#
9922c6d2 |
| 22-Nov-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
Fix various things about SIGINT handling: * exception handlers are now run with interrupts disabled, which avoids many race conditions * fix some cases where SIGINT only aborts one command and cont
Fix various things about SIGINT handling: * exception handlers are now run with interrupts disabled, which avoids many race conditions * fix some cases where SIGINT only aborts one command and continues the script, in particular if a SIGINT causes an EINTR error which trumped the interrupt.
Example: sh -c 'echo < /some/fifo; echo This should not be printed' The fifo should not have writers. When pressing ctrl+c to abort the open, the shell used to continue with the next command.
Example: sh -c '/bin/echo < /some/fifo; echo This should not be printed' Similar. Note, however, that this particular case did not and does not work in interactive mode with job control enabled.
show more ...
|
#
eaa34893 |
| 22-Nov-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Ensure the same command input file is on top after executing a builtin.
This avoids weirdness when 'fc -e vi' or the like is done and there is a syntax error in the file. Formerly an interactive
sh: Ensure the same command input file is on top after executing a builtin.
This avoids weirdness when 'fc -e vi' or the like is done and there is a syntax error in the file. Formerly an interactive shell tried to execute stuff after the syntax error and exited.
This should also avoid similar issues with 'command eval' and 'command .' when 'command' is implemented properly as in NetBSD sh.
Special builtins did not have this problem since errors in them cause the shell to exit or to reset various state such as the current command input file.
show more ...
|
Revision tags: release/8.0.0_cvs, release/8.0.0 |
|
#
874108ae |
| 12-Nov-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
MFC @199204
|
#
640b70e4 |
| 07-Oct-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Send the "xyz: not found" message to redirected fd 2. This also fixes that trying to execute a non-regular file with a command name without '/' returns 127 instead of 126. The fix is rather simpl
sh: Send the "xyz: not found" message to redirected fd 2. This also fixes that trying to execute a non-regular file with a command name without '/' returns 127 instead of 126. The fix is rather simplistic: treat CMDUNKNOWN as if the command were found as an external program. The resulting fork is a bit wasteful but executing unknown commands should not be very frequent.
PR: bin/137659
show more ...
|
#
cbd59a4f |
| 08-Sep-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- MFC from head@196987
|
#
e16947f8 |
| 29-Aug-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sh: Fix crash with empty functions (f() { }) introduced in r196483
Empty pairs of braces are represented by a NULL node pointer, just like empty lines at the top level.
Support for empty pairs of b
sh: Fix crash with empty functions (f() { }) introduced in r196483
Empty pairs of braces are represented by a NULL node pointer, just like empty lines at the top level.
Support for empty pairs of braces may be removed later. They make the code more complex, have inconsistent behaviour (may or may not change $?), are not specified by POSIX and are not allowed by some other shells like bash, dash and ksh93.
Reported by: kan
show more ...
|