summaryrefslogtreecommitdiffstats
path: root/bin/sh
Commit message (Collapse)AuthorAgeFilesLines
* A second attempt to adjust option-parsing on a shell command, for thegad2005-05-161-1/+20
| | | | | | | | | | benefit of scripts start out as: #!/bin/sh -- # -*- perl -*- With this fix in place, we can commit a change to kern/imgact_shell.c so FreeBSD will process the `#!' line in shell-scripts in a more standard fashion. PR: 16393 Mentioned on: freebsd-arch
* Various sh(1) enhancements:keramida2005-04-151-10/+83
| | | | | | | | - Move the description of the ``-c string'' option closer to the option itself. - Add an ENVIRONMENT section (1) - Add more .Xr cross references to the SEE ALSO section. Obtained from: NetBSD (1)
* Use ``.Pq Ql'' to quote single characters, instead of ``.Pq Li''.keramida2005-03-041-17/+17
| | | | | | | This makes the resulting output more aesthetically pleasing in text-only terminals: Reviewed by: ru
* Add a section describing the exit status of the shell.keramida2005-03-041-0/+8
| | | | Obtained from: NetBSD
* Support \H, \h, \w, \W, \$ string expansion in the prompt.obrien2005-03-011-4/+91
| | | | Submitted by: mini
* Change /bin/sh so *it* implements the processing needed for scripts togad2005-02-161-11/+43
| | | | | | | | | | | | | | | | | | | | | | work as expected when they have a "shebang line" of: #!/bin/sh -- # -*- perl -*- -p This specific line is recommended in some perl documentation, and I think I've seen similar lines in documentation for ruby and python. Those write-ups expect `sh' to ignore everything after the '--' if the first thing after the '--' is a '#'. See chapter 19, "The Command-Line Interface" in 3rd edition of "Programming Perl", for some discussion of why perl recommends using this line in some circumstances. The above line does work on solaris, irix and aix (as three data points), and it used to work on FreeBSD by means of a similar patch to execve(). However, that change to execve() effected *all* shells (which caused other problems), and that processing was recently removed. PR: 16393 (the original request to fix the same issue) Reviewed by: freebsd-current (looking at a slightly different patch) MFC after: 1 week
* /*- or .\"- or #- to begin license clauses.imp2005-01-1014-4/+31
|
* Scheduled mdoc(7) sweep.ru2005-01-091-1/+1
|
* Correct typo.ceri2005-01-041-1/+1
|
* o Add a missed "." .maxim2004-12-021-1/+1
| | | | | Reviewed by: ru MFC after: 3 weeks
* o Terminate an endless loop sh -T goes into in dowait() around waitproc().maxim2004-12-021-1/+2
| | | | | | | | | | | | XXX from Tor: "The shell can also go into a similar loop if the child was killed by signal 127, since the shell would believe the child to have only stopped (WIFSTOPPED() macro returns nonzero value). Disallowing signals 127 and 128 will fix that problem." See kern/19402 for details. PR: bin/66242 Submitted by: tegge Analysis and testcase by: demon MFC after: 3 weeks
* When listing the special $ variables, ($!, $#, etc) list them as $!alfred2004-11-011-12/+16
| | | | | | | | instead of just !, this allows one to more easily locate/understand the section of the manpage in question. Additional wording correction by: keramida Reviewed by: keramida
* Attempting to unset an undefined variable or function should not bedes2004-09-272-2/+2
| | | | | | | | considered an error according to the Open Group Base Specification. PR: standards/45738 Submitted by: Matthias Andree <matthias.andree@web.de> MFC after: 3 days
* Document missing multibyte character handling in utilities specifiedtjr2004-07-031-1/+5
| | | | by POSIX.
* Deal with double whitespace.ru2004-07-031-1/+1
|
* Mechanically kill hard sentence breaks.ru2004-07-022-96/+192
|
* Include <stdio.h> for a sprintf() prototype.stefanf2004-05-241-0/+2
| | | | Approved by: das (mentor)
* Document the "return" built-in better: it will exit . (sources) andgreen2004-04-141-1/+7
| | | | the top-level shell instance, too.
* Remove clause 3 from the UCB licenses.markm2004-04-0666-264/+0
| | | | OK'ed by: imp, core
* Install /bin/sh safely. This allows a shell script to be usedru2004-03-181-0/+1
| | | | | | | to strip binaries by specifying it in the STRIPBIN environment variable honoured by install(1). MFC after: 3 days
* style.Makefile:johan2004-02-231-1/+1
| | | | Use WARNS?= instead of WARNS=
* style(9): wrap at 80 columns.njl2004-02-121-3/+5
|
* Handle proper formatting and a buffer overrun when running an old sh onnjl2004-02-121-7/+28
| | | | | | | a system that has sys_nsig > NSIG (i.e. when libc is upgraded.) Submitted by: Matt Dillon Reviewed by: bde
* Fixed style of DPADD and LDADD assignments as per style.Makefile(5).ru2004-02-051-2/+2
|
* Commit fix sent by Tor Egge <Tor.Egge@cvsup.no.freebsd.org>cracauer2004-02-051-1/+1
| | | | | | | | | | Only use return value from system call if system call succeeded. Tested with `make world` and some of my own scripts. This should be MFCed soon. While /bin/sh is hard to test the fix is obviously correct and can be assumed not to break something else (famous last words...).
* Use sys_nsig instead of NSIG for the length of the signal arrays. Thisnjl2004-01-282-6/+6
| | | | | | | is important if we add new signals later. From DragonflyBSD: jobs.c:1.4, trap.c:1.3. Obtained from: DragonflyBSD
* The PR diff I committed recently had one bug noticed bycracauer2004-01-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Joe Marcus Clarke <marcus@FreeBSD.ORG>, subshells could lose a non-zero exit status. This commit is Joe's proposed patch. Thanks! I verified that the problem Joe found is fixed and I ran a full world with this patch. I don't plan to ever commit language patches to /bin/sh again. It is a minefield too big to navigate without a full-time committment, which I am not willing to do on our /bin/sh. Under normal circumstances I would recommend using NetBSD's sh which has a lot of language fixes (like the ones what these patches were about) but unfortunately they had implemented broken signal behaviour for shellscript containing interactive programs. Similar issues apply to pdksh which is OpenBSD's sh. From my perspective bash2 is the only really working bourne sh out there and that one is GPLed. Oh well.
* Replace home-grown dup2() implementation with actual dup2() calls. Thisdes2004-01-215-43/+13
| | | | | | | should slightly reduce the number of system calls in critical portions of the shell, and select a more efficient path through the fdalloc code. Reviewed by: bde
* Removed duplicate y.tab.h from SRCS and CLEANFILES.ru2004-01-201-1/+1
|
* o Spell 'diretories' correctly.maxim2003-12-301-1/+1
| | | | | | PR: misc/60730 Submitted by: Eugene Grosbein MFC after: 3 days
* PR 28852cracauer2003-12-281-24/+1
| | | | | | | | | | | | | | | sh -e behaviour was incorrect when && and || statements where used in "if" clauses. This is the patch submitted by MORI Kouji <mori@tri.asanuma.co.jp>. It fixes the issue at hand, but sh fixes like this are super-hard to verify that they don't break anything else. I ran some of my old test cases and a few big GNU configure scripts that detected mistakes before, with the previous sh, patched sh and bash. No differences in behaviour found. MFC recommended after longer than usual time. Compiles on i386 and sledge.
* Do not assume there is only a space between #define and the macro nameschweikh2003-09-131-1/+1
| | | | | | | | when grepping for JOBS. The recent style cleanup replaced the space with a tab and broke job control detection. Little edits, disastrous consequences. Submitted by: Peter Edwards <pmedwards@eircom.net> X-MFC when: in about 5 weeks with the other sh arithmetic fixes.
* mdoc(7): Use the new feature of the .In macro.ru2003-09-081-1/+1
|
* Fix testing of arith_assign() value for $((a=15)).schweikh2003-09-071-1/+1
| | | | Submitted by: Enache Adrian <enache@rdslink.ro>
* #include <string.h> for prototypes for strcpy() and strlen().tjr2003-09-061-0/+2
| | | | Submitted by: Stefan Farfeleder
* Style cleanup, mostlyschweikh2003-09-044-207/+246
| | | | Requested by: bde
* Implement missing shell arithmetic operators in $(()) expansionschweikh2003-08-304-49/+236
| | | | | | | | | | and variable recognition. PR: standards/52972 Submitted by: Wartan Hachaturow <wart@tepkom.ru> Reviewed by: tjr (improved on original patch) Tested by: buildworld on CURRENT. MFC after: 6 weeks
* Remove collate_range_cmp() stabilization, it conflicts with rangesache2003-08-031-9/+2
|
* Changes following CScout analysis:dds2003-07-0513-38/+37
| | | | | | | | | | | - Removed dead declarations - Made objects that should have been declared as static, static. The changes use STATIC instead of static, following the existing convention in the rest of the code. Approved by: schweikh (mentor) MFC after: 2 weeks
* Instead of eating trailing newlines after inserting them into thefenner2003-05-311-5/+12
| | | | | | | | | | | | | output buffer, don't insert them at all. This prevents a buffer *underrun* when the substitution consists completely of newlines (e.g. `echo`) and the byte before the source buffer to which p points is a '\n', in which case more characters would be removed from the output buffer than were inserted. This fixes certain port builds on sparc64. Approved by: re (scottl) Reviewed by: des, tjr
* mdoc(7) police: A better version of the same.ru2003-05-161-2/+2
| | | | Approved by: re (blanket)
* Centralize _PATH_* definitions.obrien2003-05-051-1/+2
| | | | Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)
* The is_name and is_in_name macros are FUBAR'ed.obrien2003-05-021-0/+2
| | | | | | Due to the use of signed vs. unsigned chars on our various platforms, one gets "warning: comparison is always true due to limited range of data type" from GCC 3.3.
* Quiet warnings about copyright[].obrien2003-05-014-8/+8
|
* Fix references to non-existing or obsoleted man pages.schweikh2003-04-301-2/+1
| | | | | PR: docs/51480 (only a small part) Submitted by: Diomidis D. Spinellis <dds@aueb.gr>
* Document the -L and -P options to the cd and pwd commands as beingtjr2003-04-121-3/+3
| | | | | | mutually exclusive. The fact that the most recent one specified on the command line is the one that takes effect is an implementation detail and users should not rely on this.
* Flush the output buffers before forking a child process to avoidtjr2003-03-171-0/+1
| | | | | | | the child process writing data that the parent should have written. PR: 50051 MFC after: 2 weeks
* Fixed (soon might be fatal) -Wformat warnings.ru2003-03-151-2/+3
|
* Third attempt at removing machdep.h and using ALIGN from <sys/param.h>.marcel2003-02-243-101/+54
| | | | | | | | | | | | | | The initial stack_block is staticly allocated and will be aligned according to the alignment requirements of pointers, which does not necessarily match the alignment enforced by ALIGN. To solve this a more involved change is required: remove the static initial stack and deal with an initial condition of not having a stack at all. This change is therefore more risky than the previous ones, but unavoidable (other than not using the platform default alignment). Discussed with: tjr Approved and reviewed by: tjr Tested on: alpha, i386, ia64 and sparc64
* Revert ALIGN change for the second and last time. I can't figure outtjr2003-02-183-6/+56
| | | | why this is breaking sparc64.
OpenPOWER on IntegriCloud