Commit Graph

193 Commits

Author SHA1 Message Date
brian
89a0a9cf18 Implement the <> redirection operator. 2000-10-03 23:13:14 +00:00
cracauer
1483cf9cb7 Disable part of my 8-bits fixes from December 1999.
Serious fix still needed, see discussion on -current
(Subject: /bin/sh dumps core with here-document of 8bit text)

Problem in this code originally spotted by
Jun Kuriyama <kuriyama@FreeBSD.org>
2000-08-16 12:23:57 +00:00
cracauer
42bbf4dc06 Fix type builtin for absolute paths and relative paths with directory
names in them.

Also use a colon in the answer of `type` everytime the questioned item
is not usable.

PR:		bin/20567
2000-08-16 12:08:02 +00:00
cracauer
0a28a3436d From submitter:
growstackblock() sometimes relocates a stack_block considered empty
without properly relocating stack marks referencing that block.
The first call to popstackmark() with the unrelocated stack mark
as argument then causes sh to abort.

Relocating the relevant stack marks seems to solve this problem.

The patch changes the semantics of popstackmark() somewhat.  It can
only be called once after a call to setstackmark(), thus cmdloop() in
main.c needs an extra call to setstackmark().

PR:		bin/19983
Submitted by:	Tor.Egge@fast.no
Reviewed by:	Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
2000-08-16 10:39:43 +00:00
sheldonh
e1fc0d32ca Mark up the -a flag to unalias as a flag (Fl), not an argument (Ar). 2000-07-24 15:02:04 +00:00
sheldonh
d7e5357331 Add missing punctuation to one line. 2000-07-24 14:59:50 +00:00
marko
e33a4a8758 Document the builtin echo command
Reviewed by:	Matthew Hunt <mph@astro.caltech.edu>
2000-07-17 23:37:55 +00:00
sada
7e8874695e Fixd with alias missing.
PR:		bin/19475
Approved by:	Martin Cracauer <cracauer@cons.org> (with conditions)
2000-07-15 14:34:37 +00:00
mph
bedabe82c4 Add \a and \e to "echo -e" escape handling. 2000-06-26 22:43:30 +00:00
cracauer
5b8d64c4b3 Fix parsing of string for eval command.
PR:		18447
Submitted by:	Koji Mori <mori@tri.asanuma.co.jp>
2000-05-15 13:02:07 +00:00
cracauer
31c479dcd8 Fix environment passung to eval'ed commands.
PR:		bin/6577
Submitted by:	Anatoly Vorobey <mellon@pobox.com>
Approved by:	silence amoung other sh experts
2000-05-15 12:33:17 +00:00
cracauer
0214561bf1 Rename the trace() function (that is build only in the -DDEBUG=2
case), so that it doesn't clash with the ncurses function of the same
name when linking statically with -ltermcap.

The linker only complains when -static is used, and it is not clear
whether this is a bug.

PR:		bin/18104
Submitted by:	Anatoly Vorobey <mellon@pobox.com>
2000-04-20 11:39:11 +00:00
cracauer
0732301c64 Include <errno.h> when compiling with -DDEBUG=2
PR:		bin/18104
Submitted by:	mellon@pobox.com
2000-04-20 09:55:57 +00:00
cracauer
72606bd24b Fix warnings, some of them serious because sh violated name
spaces reserved by the header files it includes.

mkinit.c still produces C code with redundant declarations, although
they are more harmless since they automatically derived from the right
places.
2000-04-20 09:49:16 +00:00
imp
ec1733ae3b Use #include <errno.h> rather than extern int errno;. 2000-04-14 06:03:39 +00:00
cracauer
b0d269b71d Fix ${#varname} (getting length of string) when in double-quotes.
Approved-by:	jkh

PR:		bin/12137
Submitted by:	"Danny J. Zerkel" <dzerkel@columbus.rr.com>
2000-02-15 08:00:11 +00:00
cracauer
6d35bd2d53 Fix command hash handling on
PATH=... command

Noted by and fix works for Marcel Moolenaar <marcel@scc.nl>
1999-12-20 13:42:59 +00:00
cracauer
a6c2f2ad3b Second part of 8-bit fixes. 1999-12-16 12:03:46 +00:00
cracauer
daba963c8a Document ulimit -b for RLIMIT_SBSIZE. 1999-12-15 16:12:32 +00:00
cracauer
ea70a76b31 First round of 8-bit fixes. 1999-12-15 11:46:32 +00:00
cracauer
afc2bd855c make '|' character visible.
PR:		docs/15265
Submitted by:	takamune@avrl.mei.co.jp
1999-12-05 12:13:54 +00:00
cracauer
46e40e0c76 Fix "subscript has type `char'" warnings by casting to int, as
discussed on -arch.
1999-12-04 17:12:47 +00:00
cracauer
903b2c868c Include strerror(errno) in error messages after failed system calls.
Fix a warning.
1999-11-29 19:11:01 +00:00
sheldonh
52bb19a82f Follow-up on mdoc fixes in rev 1.35; this includes things that I missed
in that revision as well as things I broke in that revision.  A note-
worthy instance of the latter case was the inversion of -E and -V in the
subsection on Commandline Editing.
1999-11-18 08:13:21 +00:00
cracauer
82902b2e3c The pipleline problem introduced in version 1.22 wasn't fully fixed in
1.23. This revision should work for long pipes both in
here-documents/backquote and in normal cases.

Fix works for jmz, bde.
1999-11-17 16:53:34 +00:00
sheldonh
2f18ba64a9 Don't call bash(1) a Korn shell clone. Instead, use pdksh(1) as an
example of such a clone.

PR:		14601
Submitted by:	Matthias Buelow <mkb@altair.mayn.de>
1999-11-10 13:27:54 +00:00
steve
9625eca367 Correct logic from previous commit - middle processes in long pipes
don't have their stdin closed indisciminantly.

Reviewed by:	markm
1999-11-07 17:07:05 +00:00
cracauer
fffcf922ea When a backquote command inside a here-document had a pipe with more
than two processes (got that? :-), the stdin fd of the middle
processes that has just been set up was accidetially closed. Don't do
this.

PR:		bin/14527
1999-11-05 12:06:30 +00:00
cracauer
71850b08e9 Fix ';' command when used with -e flag.
PR:		bin/14509
1999-10-26 13:17:18 +00:00
green
962bd6c00c Implement ulimit -b for RLIMIT_SBSIZE. 1999-10-09 20:56:06 +00:00
sheldonh
22af2421d1 Mdoc cleanup, with a few grammar cleanups on the side.
Reviewed by:	mpp
1999-10-07 13:56:43 +00:00
sheldonh
d003c4a860 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
4000b20086 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
506aa9c1b6 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
b337d66e78 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
66312e4a8d $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
tg
da827dcea3 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
3f0530abee 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
713dd62834 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
imp
321c551969 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
da2b842fad Next approach to make loops in interactive interruptable.
PR:		bin/9173
1999-04-21 11:52:39 +00:00
max
3ee4dda734 Typo fix. 1999-04-19 18:48:26 +00:00
cracauer
fd7050b5fd Remove my temporary detection for PR 7059, Tor Egge fixed this bug.
PR:		7059
1999-04-13 12:43:55 +00:00
tegge
82a8c819f3 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
6fcc4a0cb0 Fix typo in source-explaining comment. 1999-04-12 15:23:27 +00:00
cracauer
532c73c7d7 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
e35119550e 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
1ea5fe55b8 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
affd55a23b 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
b3dc9a5f33 -T was missing in the synopsis line.
Submitted by:	BDE
1999-04-02 09:28:00 +00:00