Commit Graph

165 Commits

Author SHA1 Message Date
cracauer
484b3d2fe4 Fix ';' command when used with -e flag.
PR:		bin/14509
1999-10-26 13:17:18 +00:00
green
7c735c4220 Implement ulimit -b for RLIMIT_SBSIZE. 1999-10-09 20:56:06 +00:00
sheldonh
42bcd55468 Mdoc cleanup, with a few grammar cleanups on the side.
Reviewed by:	mpp
1999-10-07 13:56:43 +00:00
sheldonh
479f480939 Correct some hard sentence breaks. Only those surrounding the previous
commit and those which cause ugly nroff output have been fixed, since
the purpose of the style guideline which they contravene is to reduce
the sizes of deltas.

Reported by:	bde
1999-09-14 11:46:04 +00:00
sheldonh
f106663eef Improve shell documentation:
* Consistently misspell built-in as builtin.

* Add a builtin(1) manpage and create builtin(1) MLINKS for all shell
  builtin commands for which no standalone utility exists.  These MLINKS
  replace those that were created for csh(1).

* Add appropriate xrefs for builtin(1) to the csh(1) and sh(1) manpages,
  as well as to the manpages of standalone utilities which are supported
  as shell builtin commands in at least one of the shells. In such
  manpages, explain that similar functionality may be provided as a
  shell builtin command.

* Improve sh(1)'s description of the cd builtin command. Csh(1) already
  describes it adequately. Replace the cd(1) manpage with a builtin(1)
  MLINKS link.

* Clean up some mdoc problems: use Xr instead of literal "foo(n)"; use
  Ic instead of Xr for shell builtin commands.

* Undo English contractions.

Reviewed by:	mpp, rgrimes
1999-09-08 15:40:46 +00:00
sheldonh
946a5ee997 Revert to using .Xr for builtins. The cross-references don't work now,
but that doesn't mean that they will never work.

Requested by:	mpp, rgrimes
1999-08-31 12:44:52 +00:00
sheldonh
a97246ed09 Clean-up:
Fix grammar and spelling nits.
	Use .Dq and .Qq where appropriate.
	Divorce trailing punctuation from quoted elements.
	Use .Dq instead of .Xr for builtins.
	Remove trailing whitespace and blank lines.

PR:	13340
1999-08-30 10:13:04 +00:00
peter
3b7c52fb9a $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
tg
801d3d9ec2 Make the behaviour of `read -e', ie. treating backslashes as special,
the default. Add -r option for the read builtin to reverse this.

PR:		13274
Reviewed by:	cpiazza, hoek, sheldonh
1999-08-26 08:16:27 +00:00
sheldonh
1c71126f0c Fix handling of the cd command inside evaluations. It was changing PWD,
which it should not do.

PR:	12578
Reported by:	Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
Submitted by:	Niall Smart <niall@pobox.com>
1999-07-19 11:00:33 +00:00
kris
935bd87c22 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
imp
efe79e057e First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting
to int type and removal of some unused variables.

[*] This is explicitly allowed by style(9) when the single statement
spans more than one line.

Reviewed by: obrien, chuckr
1999-04-25 21:13:34 +00:00
cracauer
ea727f6428 Next approach to make loops in interactive interruptable.
PR:		bin/9173
1999-04-21 11:52:39 +00:00
max
810308da18 Typo fix. 1999-04-19 18:48:26 +00:00
cracauer
9fa20f137b Remove my temporary detection for PR 7059, Tor Egge fixed this bug.
PR:		7059
1999-04-13 12:43:55 +00:00
tegge
f3d95d849c During variable expansion, the internal representation of the expression
might be relocated.  Handle this case.
PR:		7059
1999-04-13 04:13:09 +00:00
cracauer
f198ff05fd Fix typo in source-explaining comment. 1999-04-12 15:23:27 +00:00
cracauer
2c0fbd57c9 Add a guarded abort() for the problem in PR bin/7059 (no fix so far,
this is hairy).

Reformat this file to comply to style(9). It had mixed styles before.

PR:		bin/7059
1999-04-12 14:23:36 +00:00
tegge
8ca911b938 When a variable expansion is enclosed in double quotes, the internal
representation of the expression is quoted.  Take care of this when
doing pattern matching in conjunction with trimming.

	#!/bin/sh
	c=d:e; echo "${c%:e}"

PR:		NetBSD PR#7231
Noticed by:	Havard Eidnes <Havard.Eidnes@runit.sintef.no>
1999-04-09 15:23:48 +00:00
cracauer
7222c918b9 In interactive shells, break loops to the topmost level when a child
is killed by a signal.

(In non-interactive shells - that means a shellscript - the shell just
exits, this was already working)

PR:		bin/9173
1999-04-03 12:55:51 +00:00
cracauer
b3f6418b49 Implement -a flag. A test shell script can be found at
http://www.cons.org/cracauer/download/sh-interrupt/testsuite/test_export.sh
The PR also had test cases the new version passes.

Fix typo in comment.

PR:		bin/1030
1999-04-03 11:41:46 +00:00
cracauer
efa8bf8955 -T was missing in the synopsis line.
Submitted by:	BDE
1999-04-02 09:28:00 +00:00
cracauer
7d4e1acb70 The immediate execution of traps I introduced in September 1998 (to
make /etc/rc interruptible in cases when programs hang with blocked
signals) isn't standard enough.

It is now switched off by default and a new switch -T enables it.

You should update /etc/rc to the version I'm about to commit in a few
minutes to keep it interruptible.
1999-04-01 13:27:36 +00:00
brian
959984e5f3 sh doesn't support <> redirections.
PR:	7325
1999-03-31 21:02:01 +00:00
jkoshy
17c52843e1 Add references to test(1) and expr(1). 1998-12-18 03:51:18 +00:00
imp
abd08d02db Free memory from setmode.
Obtained from: OpenBSD
1998-12-16 04:45:35 +00:00
bde
7cc3c52e40 Fixed warnx format errors in printf and csh, and snprintf format errors
in sh, by using separate macros for the 1, 2 and 3-arg calls to warnx.
(The 3-arg warnx macro in sh/bltin/bltin.h used to require bogus dummy
args.)
1998-12-07 12:14:04 +00:00
billf
16921c5f8b Fix typo. "If the an entry" --> "If an entry"
PR:		docs/8140
Submitted by:	Sue Blake <sue@vedanix.welearn.com.au>
1998-12-02 23:20:11 +00:00
tegge
ea88244cf0 Be more consistent with handling of quote mark control character.
Don't output double-quotes inside variable expansion/arithmetic
expansion region in here-documents.  When leaving the arithmetic
expansion syntax mode, adjust the dblquote flag according to
previous syntax, in order to avoid splitting of quoted variables.
1998-09-13 19:24:57 +00:00
cracauer
0a716cdf2c Narrow down conditions to break wait() to process traps.
Improve comments.
1998-09-10 22:09:11 +00:00
cracauer
6e683a82b2 Fix an inefficiency I introduced in my last commit.
Include "expand.h" vom memalloc.c to pull function declartion into scope
1998-09-10 14:51:06 +00:00
cracauer
2bc1267a9c If traps are set, they are now executed even when a signal-blocking
foreground child is running. Formerly, traps were exceuted after the
next child exit.

The enables the user to put a breaking wrapper around a blocking
application:
  (trap 'echo trap ; exit 1' 2; ./pestyblocker; echo -n)

The "echo -n" after the child call is needed to prevent sh from
optimizing the trap-executing shell away. I'm working on this.
1998-09-08 13:16:52 +00:00
tegge
f36aa446c7 Better handling of word splitting. Don't record the same region
multiple times when performing nested variable expansion, and
preserve some quoting information in order to avoid removing
apparently empty expansion result.
1998-09-06 21:13:09 +00:00
tegge
a860e83ccf Don't blindly eliminate `..' and the previous pathname component.
PR:		2541
Obtained from:	NetBSD
1998-09-06 21:01:57 +00:00
cracauer
faa80805b8 Improve bookkeeping of in_waitcmd and style fixes.
Submitted by:	Bruce Evans
1998-08-25 09:33:34 +00:00
cracauer
c7345be909 Re-enable killing childs with SIGQUIT. Spotted by Bruce Evans. 1998-08-25 08:49:47 +00:00
cracauer
2a3e4713ee Got two volatile sig_atomic_t and int mixed up. Spotted by Gary Palmer. 1998-08-24 19:15:48 +00:00
cracauer
8e91e03b52 Do not exit on SIGINT in non-interactive shells, fixes PR 1206,
i.e. this makes emacs usable from system(3). Programs called from
shellscripts are now required to exit with proper signal status. That
means, they have to kill themself. Exiting with faked numerical exit
code is not sufficient.

Exit with proper signal status if script exits on signal.

Make the wait builtin interruptable, both with and without traps set.

Use volatile sig_atomic_t where (and only where) appropriate.

(Almost) fix printing of newlines on SIGINT.

Make traps setable from trap handlers. This is needed for shellscripts
that catch SIGINT for cleanup work but intend to exit on it, hance
have to kill themself from a trap handler. I.e. mkdep.

While I'm at it, make it -Wall clean. -Wall is not enabled in
Makefile, since vararg warnx() macro calls in usr.bin/printf/printf.c
are not -Wall-able.
PR:		1206
Obtained from:	Basic SIGINT fix from Bruce Evans
1998-08-24 10:20:37 +00:00
jkoshy
856cedc623 Document behaviour of "-" and "--" on the command line.
PR: docs/5399
1998-07-30 04:47:56 +00:00
bde
44bb68bb37 Added a `build-tools' target for internal tools.
Removed explicit dependencies of foo.o on foo.c.  These were mainly
placeholders for comments about missing dependencies of tools objects
on headers.  This problem needs to be handled more generally.
1998-07-07 01:06:58 +00:00
charnier
ce4a22c986 Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
bde
c284bdb175 Backed out previous backout. Put y.tab.h back in SRCS. 1998-05-06 15:33:59 +00:00
bde
ec2ee14ca6 Backed out previous commit. It was tested, but not for the case where
a separate object tree doesn't exist.  Crufty makefiles will have to
put y.tab.h in SRCS so that we know not to create foo.h from foo.y.
1998-05-05 07:36:55 +00:00
bde
6a77e9f036 Fixed races in `make -jN' using new yacc rules. 1998-05-04 20:09:06 +00:00
cracauer
d39253d3ab When calling a shell function, remember whether exit status is tested.
This is needed for the '-e' option. See the PR for more details.
PR:		6047
Reviewed by:	PR submitter, silence on review request.
1998-05-04 07:24:10 +00:00
bde
906bdd2538 Backed out most of rev.1.19 (explicit dependencies of object files
on generated headers).  This is now handled generally in bsd.prog.mk.
1998-04-26 16:12:23 +00:00
jdp
da208a2f3e Explicitly describe the rules the shell uses to search for a file
sourced by the "." command.
1998-02-12 01:23:11 +00:00
cracauer
db65bf7f7d Back out my previous attempt to fix SIGINT/SIGTERM behaviour 1998-02-06 23:50:39 +00:00
cracauer
aa61e5bd0b Fix handling of SIGINT/SIGQUIT for foreground subprocesses. Most
urgent need is when you run sh around a program that intentionally
uses SIGQUIT/SIGINT for asynchronous events, i.e. $EDITOR started from
system(2), like many mailers do. This fixes PR bin/1206 and possibly
bin/4241.

The solution committed has been tested for a large number of possible
cases (see recent discussion on cvs-committers). I completed a make
world, made sure 'make world' is interruptable and used the changed
/bin/sh as a login shell all day, including job control and using
SIGQUIT-catching programs (to write this message :-).

PR:		bin/1206
Reviewed by:	discussion on cvs-commiters
1998-02-06 18:14:26 +00:00
steve
a5b6ea4a26 Correct a bogon in an example.
PR:		5415
Submitted by:	Sergei S. Laskavy <laskavy@pc759.cs.msu.su>
1998-01-02 19:23:05 +00:00