Commit Graph

320 Commits

Author SHA1 Message Date
steve
d8f6e783a9 Fix a problem that caused some foreground pipelines to die with:
tcsetpgrp failed, errno=1

Discovered and Reviewed by: joerg
1997-01-06 01:26:44 +00:00
steve
52b42d179f Make sh(1) think and be in the same place at the same time. This closes
PR#2331: strange output of sh's pwd on symlinked directories.
1997-01-04 19:14:29 +00:00
wosch
7d81d73be3 add some string examples, eg. test "" -o "" 1996-12-28 13:31:29 +00:00
ache
2b16798128 Use strcoll instead of strcmp for file names comparation
Should be in 2.2
1996-12-28 03:46:27 +00:00
steve
ba6ff4e22b Fix handling of -o and -a operators in the 3 argument case.
Submitted by: Tom Rush <tarush@mindspring.com>
1996-12-25 00:08:10 +00:00
steve
32099e4419 With these changes sh(1)'s trap command should be POSIX-compliant,
while remaining (becoming :) compatible with other popular shells.
Specifically these changes include:

1) Implement 'trap -l' to get a list of valid signals names.  This
   is useful if you wanted to do something like reset all signal
   handlers to there defaults values, in which case something like
   this will do the trick.

	trap `trap -l`

2) Reformat the output of 'trap' so it can be saved and later eval'd
   to restore the saved settings.

3) Allow the use of signal names as well as signal numbers.

4) Fix trap handling of SIGCHLD so that commands like the following
   (albeit, contrived) won't cause sh(1) to recurse ad infinitum.

	trap uname 0 20

5) Make variables static that are used only in trap.c.

6) Minor 'style(9) police' mods.
1996-12-24 23:59:53 +00:00
steve
1a41fac0ee Oops, it needs little more caulk to get it right. 1996-12-23 22:29:03 +00:00
steve
e758cddd74 Apply a little dab of bit caulk to keep those beggars
from leaking out.

Noticed by: bde
1996-12-23 22:16:35 +00:00
steve
e8fc075c5f Don't use _POSIX_PATH_MAX to limit the size of the path, instead
use 'getcwd(NULL, 0)' just as pwd(1) does.

Suggested by: bde
1996-12-23 05:31:48 +00:00
steve
339474da2f Make sh(1) a little braver in the face of adversity. sh(1)
now handles the getpwd() init problem the same way as bash
and ksh do.  Also while I was in here, I cleaned up the format
a little, removed some unnnecessary #if SYMLINKS cruft, and
changed the pwd builtin to use getcwd(3) as Joerg suggested.
1996-12-21 22:09:40 +00:00
steve
923b6f10b1 This doesn't change any behavior, but may be a slight
optimization.  (num-- > 0) --> (--num >= 0).

Obtained from: NetBSD
1996-12-21 15:16:32 +00:00
steve
f31edfcef6 Remove extra #undef. 1996-12-21 14:57:38 +00:00
steve
93a6aade53 Fix a problem caused by finger failure on my part. The builtin
getopts should now work as expected.  This fix was in the NetBSD
code that I was merging from but missed getting into FreeBSD's
version because of 'drain bamage' on my part.

Submitted by:	NetBSD, joerg
1996-12-21 13:21:57 +00:00
steve
5b1f411348 Merge in NetBSD mods and -Wall cleaning.
Obtained from: NetBSD, me
1996-12-14 06:20:03 +00:00
steve
d977027356 -Wall cleaning. 1996-12-14 06:16:51 +00:00
steve
c6c85815c5 Cleanup man page and -Wall cleaning. 1996-12-14 06:14:32 +00:00
steve
afda536ace -Wall cleaning and implement -p commandline option.
-p mod obtained from: NetBSD
1996-12-14 06:13:51 +00:00
steve
f36f15733f Merge Lite2 mods, and -Wall cleaning. Unimplemented undelete(2)
cruft is protected by a #ifdef (BSD4_4_LITE) that should be
removed when this is supported by the kernel.
1996-12-14 06:11:53 +00:00
steve
d20174939c -Wall cleaning. 1996-12-14 06:08:03 +00:00
steve
5898f342cc Merge Lite2 mods, cleanup man page, and -Wall cleaning. 1996-12-14 06:07:30 +00:00
steve
db2a5afcb0 Cleanup man page and -Wall cleaning. 1996-12-14 06:04:06 +00:00
steve
455b1dc2a4 Merge Lite2 mods, and -Wall cleaning. undelete(2) cruft
not yet implemented is protected by a define (BSD4_4_LITE)
that should be removed when this call is supported by the
kernel.
1996-12-14 06:03:29 +00:00
steve
9de2357cc3 Merge Lite2 mods, and -Wall cleaning. 1996-12-14 06:01:00 +00:00
steve
94cf9cfeb6 Merge Lite2 mods, -Wall cleaning, and show usage if
incorrectly called.

Incorrect usage mod obtained from: NetBSD
1996-12-14 05:59:58 +00:00
steve
fdf54f93ef Merge Lite2 mods, cleanup man page, and -Wall cleaning. 1996-12-14 05:56:03 +00:00
steve
a5f25e7408 Merge Lite2 mods, fix incorrect default string, cleanup
use of .Nm macros, and -Wall cleaning.
1996-12-14 05:54:15 +00:00
steve
9e6e305b90 Merge Lite2 mods and -Wall cleaning. 1996-12-14 05:51:58 +00:00
steve
18fa9e7722 Cleanup man page and -Wall cleaning. 1996-12-14 05:51:20 +00:00
jkh
1ac99b570c The manual page of df called cd9660 file systems by the name
isofs while the df command itself used the name iso9660fs or
        cdfs. Both of these were inconsistent with the name cd9660 which
        is used by the mount command. I modified df to recognize all of
        the names cd9660, cdfs, isofs, and iso9660fs, and take them all
        to refer to the same thing. Naturally I added a note of this
        behaviour in the manual page too.

Submitted-By: Jukka Ukkonen <jau@jau.csc.fi>
1996-12-11 10:01:56 +00:00
bde
97a2b72691 Fixed `stty [-]extproc'. It set extproc to a semi-random state (always
off if there are no other options, always (?) on if another option that
changes the state is processed earlier).
1996-12-07 11:07:20 +00:00
phk
a62660f748 Bruce says: "You have been programming in the kernel for too long :-)."
and he's right ... I forgot about this floating point stuff you can
use in user-land :-)

Increase precision of duration to microseconds.
No heuristics to avoid overflow in calculation needed - just depend
on DBL_MAX being a bit larger than LONG_MAX.

Use double instead of `struct timeval' in dd.h so that everything
doesn't have to include <sys/time.h>.

Fixed style bugs in recent and old FreeBSD changes.

Reviewed by:	phk
Submitted by:	bde
1996-11-13 20:00:03 +00:00
phk
bd404ae822 Increase precision of duration to milliseconds.
Some heuristics to avoid overflow in calculation attempted.
1996-11-12 23:09:15 +00:00
peter
fccdd7717f Back out rev 1.7 which was to fix PR#1206 (to be reopened).
This patch causes too many side effects, one of which bites hard is
when interrupting a 'make fetch' in the ports tree (PR#1990).
This whole area is a real can of worms....

This most definately should go into 2.2

Reviewed by: steve, bde
1996-11-12 18:35:06 +00:00
hsu
7256defd22 Remove unneeded #include <sys/proc.h>. 1996-11-10 06:13:12 +00:00
ache
a9e8ebac63 Replace collate_range_cmp call with its code 1996-10-31 07:22:48 +00:00
ache
713a0ab39e 1) define STATIC as static and not empty
2) replace collate_range_cmp call with its code
1996-10-31 07:15:57 +00:00
steve
f367d6c21f Add the -p (privileged) commandline switch
found in bash, zsh, and friends.

Reviewed by: joerg
1996-10-29 03:12:51 +00:00
bde
0369029705 Build intermediate object files for mkinit, mknodes and mksyntax
so that simple regresssion tests based on `cmp' work.  mkdep still
doesn't work right for these tools.  They should probably be in
separate directories.

Sorted dependencies.
1996-10-25 14:49:24 +00:00
steve
3495a323e5 Close PR# 1206. sh(1) now ignores SIGINT and SIGQUIT
when a child is forked and the -c commandline switch
has been specified.

Reviewed by: joerg
1996-10-22 03:02:07 +00:00
peter
94d11dbaaf Implement a -c option to ps to display the short command name instead of
the full argument vector.

I've bumped into a few things that expected this switch to be present,
the most recent was the snmp package in ports.  I'm not 100% sure of the
origins of this, but Linux has it, so does the "BSD-compatable" version
of ps on our SVR4 systems (so I assume SunOS has it too).
1996-10-21 07:30:26 +00:00
steve
32a3e29115 Benign | --> || correction. 1996-10-16 02:30:39 +00:00
steve
4bb7982815 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>
1996-10-06 15:17:19 +00:00
wosch
0afb8360fb delete doubled words, e.g.: "the the" -> "the" 1996-10-05 22:27:30 +00:00
peter
3ab91f52dc re-activate the printf builtin now that src/usr.bin/printf.c has been
tweaked to work as a builtin better (ie: calls the real printf formatting
code, not sh's cut-down out1fmt() function)
1996-10-01 04:59:13 +00:00
ache
c4bd96877d Activate LC_CTYPE locale and additionly use !isprint() for 8bit characters 1996-09-30 15:45:36 +00:00
imp
d5205330df Merge in the NetBSD changes to cat.c. These appear to have come from
the 4.4 lite 2 tape as well.  There are now only two diffs between
NetBSD's cat and FreeBSD's cat:
	getopt return value is -1 on NetBSD and EOF on FreeBSD.
	NetBSD has added setlocale calls before anything else.
1996-09-28 21:19:27 +00:00
bde
e571258735 Close files up to getdtablesize() instead of up to NOFILE.
csh was one of the 3 programs in /usr/src that (mis)used NOFILE.
1996-09-28 14:32:01 +00:00
wosch
e5b4420bce add forgotten $Id$ 1996-09-22 21:56:57 +00:00
nate
bc360cb6e3 ts_sec -> tv_sec
ts_nsec -> tv_nsec
1996-09-20 04:45:59 +00:00
adam
f374cb9b9b Mend 'exit' without breaking 'exit 1'
*blush* %-\

Pointed out by: bruce
1996-09-12 12:41:46 +00:00