Commit Graph

502 Commits

Author SHA1 Message Date
mpp
9baabea624 Improve the wording in the NOTES section. Closes PR# 3223. 1997-04-08 20:27:48 +00:00
mpp
b886336680 Fix several problems with mkdir:
1)  Fix mkdir -p to exit with the proper exit status and issue an error
    message if it was unable to create all of the specified directories
    and they did not previously exist.  POSIX says:

    The mkdir utility shall exit with one of the following values:

    0  All the specified directories were created successfully or the
       -p option was specified and all the specified directories now
       exist.

    E.g.

    % mkdir -p /var/mkdir
    mkdir: /var/mkdir: Permission denied

    % touch /tmp/file
    % mkdir -p /tmp/file/dir
    mkdir: /tmp/file: Not a directory

    Previously the above examples would exit with a zero exit status
    and no error message.  Something like the following run as a
    normal user will still not produce an error:

    % id
    uid=629(mpp) gid=629(mpp)....
    % mkdir -p /usr/local/etc
    % ls -ld /usr/local/etc
    drwxr-xr-x  4 bin  bin  512 Dec 26 14:55 /usr/local/etc/

2)  Cleaned up the mode handling to be more efficient when multiple
    directories are being created.

3) Fixed a problem where directories could be created with the wrong mode
   if the the -p option was specified and the build() routine returned
   and error.  It would leave the umask set incorrectly at this point.

4) Removed an unused variable.

Closes PR# 2304.
1997-04-01 23:46:22 +00:00
imp
cd84ece5fd compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
imp
cdc0e920d8 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
obrien
a09ae5e9bd make usage() and SYNOPSIS agree with each other and add missing options
documented in the DESCRIPTION section.
1997-03-26 17:48:40 +00:00
imp
ad42e7a13f Use mkstemp rather than mktemp to prevent races.
Obtained from: OpenBSD
1997-03-24 05:45:29 +00:00
bde
1d35a01a65 Merged from Lite2. The -t option is now handled better. The only visible
change should be that the usage message now actually matches the man page.
1997-03-13 17:41:37 +00:00
bde
909dc1b5d2 Merged from Lite2. The man page no longer attempts to list all the
vfs types.

Fixed ordering of FreeBSD `k' option in synopsis.
1997-03-13 17:32:39 +00:00
bde
52b723e9b1 Merge from Lite2. Straightforward changes. 1997-03-13 17:29:08 +00:00
mpp
1b659768bd Correct the self reference in the description of the "tabs" option.
It should really refer to "oxtabs".

Obtained from: NetBSD-bugs mailing list PR# 3320
1997-03-12 15:59:22 +00:00
guido
6424c35fe5 Fix buffer overflow 1997-03-10 19:52:12 +00:00
guido
301e38a7c7 This is a funny one: df for a device that was not mounted used to fail
for root only.
1997-03-10 19:39:43 +00:00
guido
ee328d1053 Fix buffer overflow (probably unexploitable). 1997-03-10 19:10:08 +00:00
guido
b8d3beac13 Make mv more robust. A race has been fixed, as well as an extra warning
added when sbits are cleared.
Fixes PR 1351 and 1377 (I hope).
1997-03-08 16:05:44 +00:00
mpp
d8a1c85007 Typo fix. 1997-03-07 01:58:56 +00:00
joerg
fbe645d9f1 Acitvate chio(1). 1997-03-06 15:30:53 +00:00
joerg
f80cb70ae2 This commit was generated by cvs2svn to compensate for changes in r23449,
which included commits to RCS files with non-trunk default branches.
1997-03-06 15:30:06 +00:00
joerg
22817fb6a1 Import Jason Thorpe's contribution for an updated SCSI media changer
device (now, finally!).
1997-03-06 15:30:06 +00:00
ache
ef8eca45e6 Big usernames fixes 1997-03-04 00:33:56 +00:00
ache
d653dc5901 Use MAXLOGNAME-1 for width because MAXLOGNAME includes NUL 1997-03-03 08:20:28 +00:00
mpp
5eda08fa42 Add a missing period in the -o option description.
Document the depreciated -g option.

Inspired by: OpenBSD PR# 119
1997-02-25 00:26:53 +00:00
peter
34fd560164 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
mpp
297ecb20eb Use the .Bx macro in the HISTORY section. 1997-02-19 07:14:30 +00:00
obrien
9f6eb5fe55 Add history section. Follows chflags(2). 1997-02-19 00:32:35 +00:00
jkh
3626596097 Include <ufs/ufs/ufsmount.h>. 1997-02-17 05:26:08 +00:00
steve
d9abae43ae Fix a expansion bug that caused the result of echo $((1 << 30))
to get truncated.

Submitted by: bde
1997-02-16 01:54:19 +00:00
alex
ee019a53dc Sweep through the tree fixing mmap() usage:
- Use MAP_FAILED instead of the constant -1 to indicate
    failure (required by POSIX).
  - Removed flag arguments of '0' (required by POSIX).
  - Fixed code which expected an error return of 0.
  - Fixed code which thought any address with the high bit set
    was an error.
  - Check for failure where no checks were present.

Discussed with:	bde
1997-01-16 21:58:40 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
wosch
e902881dbf Sort cross references. 1997-01-13 00:25:51 +00:00
mpp
0ed99fc645 Minor mdoc cleanup. 1997-01-11 19:47:07 +00:00
mpp
4112c40287 Add a blurb describing the fact that ls will print the
year in place of the hour/minute fields if the time is
more than 6 months in the past or future.

Also some minor mdoc cleanup.
1997-01-11 19:24:22 +00:00
mpp
ae122c8fd8 Make ls include the year when displaying times that are more than
6 months into the future.  Closes PR# 1657.

Submitted by:	Sakari Jalowaara <sja.home.tekla.fi>
1997-01-11 19:15:53 +00:00
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
bde
bcdb488687 Backed out last change. It broke even `exit 1'. 1996-09-12 02:23:33 +00:00
peter
db2857f895 Ok, lets try this again, shall we? It was definatly my mistake, not
Steve's.. :-]
1996-09-10 02:42:33 +00:00
peter
af0920bcd6 ack! back these out so I can see what I did wrong. It looks like a
patch-by-hand botch, but it sig-11's during make world.
1996-09-10 02:07:27 +00:00
peter
33a6051a24 Fix for PR#1248, sh doesn't expand past ${9}
Submitted by: Steve Price <sprice@hiwaay.net>
1996-09-10 01:24:11 +00:00
adam
49151c9e61 let the "exit" command return status when it is implicit 1996-09-08 03:12:22 +00:00
peter
be08e0eb02 eek, how did that happen? I must have committed something left over from
when I was experimenting looking for an alternate format.  *blush*
1996-09-03 14:24:44 +00:00
peter
3d3bb118e8 Fix for PR#1287. This makes sh behave sensibly in case statements in the
face of aliases.  Note, bash doesn't do aliases while running scripts, but
"real" ksh does..

Also:
  Reduce redundant .Nm macros in (unused) bltin/echo.1
  nuke error2, it's hardly used.
  More -Wall cleanups
  dont do certain history operations if NO_HISTORY defined
  handle quad_t's from resource limits

Submitted by: Steve Price <sprice@hiwaay.net>  (minor tweaks by me)
1996-09-03 14:16:06 +00:00
peter
4698317f56 Misc cleanups and fixes from Bruce:
- don't put \n on error() calls, error adds it already.
 - don't prepend "ulimit" on error() calls in miscbltin.c.
 - getopt typo on ulimit -p -> -u conversion
 - get/setrlimit() calls were not being error checked

ulimit formatting cleanup from me, use same wording as bash on Bruce's
suggestion.  Add ulimit arg to output on Joerg's suggestion.
1996-09-03 13:35:11 +00:00
peter
cf52863d71 oops, I didn't mean for the unconditional DEBUG code to go in, it's been
off in FreeBSD for some time.  I realised this a few seconds after the
commit started..
1996-09-01 10:27:49 +00:00
peter
db1e9c387e 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
1996-09-01 10:22:36 +00:00
wosch
d4a1c1cff8 [HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
1996-08-29 18:06:19 +00:00
adam
f62400e2ee set error status on exit, to be consistent with manpage and standard commands. 1996-08-27 21:51:48 +00:00
wosch
e99625b29c sync copyright with /usr/share/examples/etc/bsd-style-copyright 1996-08-27 20:04:45 +00:00
wosch
49b42d2ad0 [HISTORY]
cat command appeared in Version 1 AT&T UNIX, not Version 6
	Apparently the cat man page was the first written man page

	Obtained from: A Quarter Century of UNIX, Peter H. Salus
[BUGS]
	fix a typo
1996-08-22 16:54:12 +00:00
ache
545ed1a8d9 Take out 0201-0207 range - those characters abused by sh 1996-08-12 22:14:50 +00:00
ache
14436b9fc7 Convert to newly added collate compare function 1996-08-12 21:32:15 +00:00
ache
7c73661dad Convert to newly added collate compare function 1996-08-12 19:31:11 +00:00
ache
907d8c43f6 Simplify expression 1996-08-12 12:31:28 +00:00
ache
14738091c0 Use collate for alpha character ranges 1996-08-12 02:08:43 +00:00
ache
9f8c58b3e3 Fix unsetenv of locale variable 1996-08-11 23:10:38 +00:00
ache
7792694e18 Localize it 1996-08-11 22:51:00 +00:00
ache
3020663efc Pick collate info for RE character ranges 1996-08-11 16:59:27 +00:00
ache
9257d220bd Localize it
8bit cleanup
1996-08-11 16:48:11 +00:00
adam
2837ce3d40 chmod(2) directories once only (was twice) 1996-08-10 15:05:26 +00:00
dg
78821ab874 Updated to match kernel changes for timer/run queue. 1996-07-31 09:27:23 +00:00
wosch
731cb1dfec add a reference to killall(1) 1996-07-03 22:19:50 +00:00
mpp
c336415f2a The default swap device is /dev/drum, not /dev/swap
as ps.1 states.

Submitted by:	Zahemszhky Gabor <zgabor@code.hu>
1996-07-03 22:17:28 +00:00
mpp
4a0cc4e3f1 Fix some minor formatting problems in some examples.
Obtained from:  Partially obtained from NetBSD-bugs mailing list
1996-07-03 01:28:34 +00:00
peter
94fb710c77 Make %CPU add up closer to 100%.. At least, it now agrees with top.. :-)
Pointed out by: bde
1996-06-29 10:25:31 +00:00
peter
8facdff20e Fix (I think) the %MEM count in 'ps -u'. It was bogusly taking the
vm_rssize (in pages, not bytes), then dividing (bogusly) by the page size,
then using that as a fraction of the total pages.
1996-06-29 08:04:05 +00:00
jkh
e693c16dd8 Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
1996-06-24 04:26:21 +00:00
wosch
69fdab67e4 Add a better TEST script. I was surprised how much can be wrong
with program test(1) or builtin test(1).
1996-06-19 00:44:44 +00:00
phk
166aa207ac Backup yacc changes. 1996-06-02 17:06:40 +00:00
phk
c2282491a3 Backout yacc changes 1996-06-02 17:05:48 +00:00
phk
39936ba9bb Use new yacc rules. (I'm fixing the tree as fast as I can :-) 1996-05-30 20:52:26 +00:00
phk
914a0cafaf Use default yacc rule. 1996-05-30 20:44:09 +00:00
peter
ba3e035290 This commit was generated by cvs2svn to compensate for changes in r15920,
which included commits to RCS files with non-trunk default branches.
1996-05-27 01:41:12 +00:00
peter
28012a479c 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)
1996-05-27 01:41:12 +00:00
peter
1257227edf Nuke the undocumented -F flag, since it doesn't do anything anymore.
It used to allow root to hard-link directories (and screw up programs that
expexted the ".." entry to point to the parent dir)
1996-05-24 20:36:16 +00:00
tg
83c817dbd7 Output line count to stdout. Complies to POSIX.2.
Reviewed by:	joerg
1996-05-23 06:36:34 +00:00
wosch
5c15c67589 `mv'' -> `mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
1996-05-07 23:19:49 +00:00
phk
e2bbf084a5 CLSIZE -> getpagesize() 1996-05-02 13:06:21 +00:00
phk
201f1269c8 Replace NBPG with getpagesize() 1996-05-02 08:37:16 +00:00
smpatel
20e67baee3 Fix up the badly out of date struct proc's p_flags.
Flags aren't printed in hexadecimal, as documented.
1996-04-19 22:23:27 +00:00
mpp
e6d2f2986f Correct some cross references and some path names. 1996-04-06 09:47:30 +00:00
ache
1aba75c7ca For nonexisten time use proper diagnostic instead of bad format and usage 1996-04-06 01:42:09 +00:00
ache
5fd41d593f Use unsigned char for isprint 1996-03-31 16:14:11 +00:00
bde
414c8f4b91 Fixed typo.
Reported by:	andreas@knobel.gun.de
1996-03-31 02:29:13 +00:00
nate
440eb4df65 Fix 'stutter' in manpage.
The man page for date(1) talks about "a a" maximum, not just
    "a" maximum.

Submitted by:	Simon Burge <simonb@telstra.com.au> via NetBSD GNATS
1996-03-12 05:30:39 +00:00
joerg
693dd454a4 err() --> errx() for non-errno related failures. 1996-03-11 11:01:03 +00:00
wosch
c9b4fb2252 Option -f implemented (remove + create)
option -f and -i are exclusive
respond `Y' is equal to `y'
fix usage string
remove isatty(3) check

Reviewed by:	pst
1996-03-08 06:58:08 +00:00
wosch
fbfd06b398 fix usage string
respond `Y' is equal to `y'

Add a note how to delete file name with beginning `-'
1996-03-07 23:26:59 +00:00
wosch
a17e60b561 delete unused label endarg
correct indent of last new code
fix usage string, option -f before option -i (alphabetic order)
1996-03-01 06:14:13 +00:00
wosch
a4158c0ec5 option -f and -i are exclusive (Posix)
respond `Y' is equal to `y'
update usage string
prompt only if source exist
1996-02-20 23:27:57 +00:00
pst
149ff31550 Don't initialize udata, fix usage string 1996-02-19 05:57:22 +00:00
pst
47e06c1e28 Don't initialize udata, remove bogus case, fix usage string 1996-02-19 05:56:34 +00:00
pst
ba5d3491e4 -- is implemented in getopt(3)
-? is an unnecessary case statement and not useful
1996-02-19 05:51:13 +00:00
wosch
2a9518f55e delete my last commit
Submitted by:	pst, ache
1996-02-19 00:44:19 +00:00
pst
0b55bfa8d9 Remove unnecessary '?' case and don't zero global udata, it's already zero 1996-02-18 19:54:04 +00:00
wosch
969d6e965c update usage string
all flag variables initialized with zero
respond `Y' is equal to `y'
1996-02-18 19:00:59 +00:00
wosch
a027b5fde4 Option -f implemented (remove + create)
option -f and -i are exclusive
all flag variables initialized with zero
respond `Y' is equal to `y'
update usage string
1996-02-18 18:48:26 +00:00
wosch
1b1def816a option -f and -i are exclusive
all flag variables initialized with zero
respond `Y' is equal to `y'
update usage string
prompt only if source exist

ignore -i option if file descriptor stdin not refers to a valid
terminal type device
1996-02-18 18:44:58 +00:00
joerg
d4cf537a64 Add an .Xr for chflags(1) into the SEE ALSO sectoin.
Submitted by:	jhs
1996-02-16 00:08:53 +00:00
mpp
ff87a22e97 Added a update(4) man page to describe the kernel initiated update
process and changed all of the old references to update(8) to update(4).
1996-02-12 00:45:47 +00:00
mpp
bda6e1c756 Correct a bunch of man page cross references and generally
try and silence "manck".

ncurses, rpc, and some of the gnu stuff are still a big mess, however.
1996-02-11 22:38:05 +00:00
markm
1bc7ca8305 #include <kerberosIV/des.h> -> #include <des.h> 1996-02-11 09:18:18 +00:00
pst
7eff8f18b2 Close bin/937 - handle negative timestamps 1996-02-08 21:06:40 +00:00
joerg
36d37235bb Fix the borokeness that crept in with rev 1.10 of parser.c, the sh
didn't correctly start background jobs anymore.  Strange that nobody
was complaining...

Add a dummy target for `builtins' in the Makefile, to prevent it
from attempting to build this file by compiling builtins.c. :-/
1996-02-03 13:27:55 +00:00
mpp
98bcf4c755 Fix some incorrect locations in the FILES sections of some man pages. 1996-02-02 18:22:04 +00:00
mpp
832c3759d7 Fix some spelling errors. 1996-01-29 22:53:24 +00:00
mpp
049661b89b Use the correct buffer size from limits.h for the error buffer
passed to kvm_open.  Closes PR# 476.

Submitted by:	Jeffrey Hsu <hsu@freebsd.org>
1996-01-20 10:43:54 +00:00
mpp
1c930965a4 Remove unused include of utmp.h from print.c. Closes PR# 486.
Submitted by:	Tom Samplonius <tom@haven.uniserve.com>
1996-01-20 10:31:14 +00:00
bde
09b2ad8f57 Partially fixed negative and truncated "Avail" counts in df output.
This fixes PR943.

ffs/ffs_vfsops.c:
ffs_statfs() multiplied by (100 - minfree) as part of calculating the
minfree percentage (complemented in 100%), so with the standard minfree
of 8, it was broken for file systems of size >= 1TB/92 = 11GB.  Use the
standard freespace() macro instead.  This also fixes a rounding bug (the
"Avail" count was sometimes 1 too small).

ffs/* (not fixed):
The freespace() macro multiplies by minfree, so with the standard
minfree of 8, it is broken for file systems of size >= 1TB/8 = 128GB.
This bug is more serious since it affects block allocation.

ffs/ffs_alloc.c (not fixed):
Ordinary users are sometimes allowed to allocate 1 (partial) block
too many so that the "Avail" count goes negative.  E.g., if there is
1 fragment available and the file is fairly large, one more full
block is allocated.

df/df.c:
ufs_df() used/uses essentially the same code as ffs_statfs(), so it
had/has the same bugs.

ufs_df() gratuitously replaced "Avail" counts of < 0 by 0, so it
gave different results for non-mounted file systems in this case.
1996-01-14 18:55:09 +00:00
peter
d7b348d79e oops. I forgot to add the "[-U username]" option to the usage string. 1996-01-12 08:49:43 +00:00
peter
6470cdf2a0 This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.
1995-12-30 19:02:48 +00:00
joerg
65600dbbe6 Print dev minor #'s > 255 in hex.
Reviewed by:	jkh, kuku, phk
1995-12-30 18:15:30 +00:00
joerg
b47c269c8d Small man page tweaks:
. mention the need for procfs
. make it clear that default sorting is first by ctty, then by PID

Submitted by: schweikh@ito.uni-stuttgart.de (Jens Schweikhardt)
1995-12-30 13:52:02 +00:00
peter
9b80d26c22 Implement a new option to ps.. `-U username'. This allows you to
list the processes belonging to a particular user without having to use
`-u' and grepping for the username.  Basically you can now get a short
`ps -x' like list (with more space for the command) for other users.
1995-12-26 03:38:55 +00:00
bde
64aab4356c Restored formatting from the old printf/printf.c. 1995-12-14 23:19:36 +00:00
joerg
2dd6ac9b28 The shell incorrectly gave & precedence over ;. This breaks the
traditional behaviour, and it violates Posix.2.

Fixes PR # bin/880: /bin/sh incorrectly parse...

Fixes also an earlier problem report about the shell not evaluating
loops correctly.  (Not files via GNATS.)

Submitted by:	nnd@itfs.nsk.su (Nickolay N. Dudorov)
1995-12-10 17:59:23 +00:00
joerg
402a79f826 Move out some of the shell builtin bogosity from printf's source to
sh's builtin/bltin.h.
1995-12-10 15:40:42 +00:00
joerg
80972db9d7 Fix my own brokeness for the colon operator, when one of the arguments
was a valid integer.  The actual decision between integer and string
is now context-dependant on the operator being used.
1995-11-18 18:05:03 +00:00
peter
0017db9c16 A fix for the "cd -" coredump on a brand new /bin/sh. The problem was
noticed on a NetBSD bugs mailing list but this is entirely my own work.

Inspired by: Scott Reynolds <scottr@plexus.com>, for NetBSD
1995-11-14 01:04:52 +00:00
bde
8405e72006 Fixed descriptions of ignpar and parmrk. 1995-11-11 03:31:13 +00:00
peter
bce518cbd3 Implement allowing 'set -v' in the middle of a script to work.
This means that a script containing:
  echo 1
  set -v
  echo 2
will now produce output, like it does on SYSV machines and other 'proper'
/bin/sh implementations..

This is done by a slight restructure of the input processor allowing it to
read chunks from the file at a time, but process the data by line from the
chunk.

Obtained from:  Christos Zoulas for NetBSD. <christos@deshaw.com>
1995-11-03 18:50:14 +00:00
phk
1acffefabf I add #include <sys/user.h> 1995-10-28 20:11:18 +00:00
ache
b7d0978d02 Fix -h option:
sense symlink even it is unresolved
1995-10-28 11:54:42 +00:00
ache
1ffe3ce1a3 Change local to LC_ALL, there is no bitmask 1995-10-26 10:57:52 +00:00
ache
4ce0ca17af Change locale to LC_ALL, there no bitmask 1995-10-26 10:56:38 +00:00
torstenb
e9d3587ad5 fix bad dependencies (LIBMATH -> LIBM) 1995-10-25 15:08:21 +00:00
ache
2fd134db5b Add missing reaction on LC_ALL and LC_COLLATE 1995-10-23 23:08:26 +00:00
ache
3424b01c58 Add setlocale LC_CTYPE 1995-10-23 21:31:48 +00:00
ache
155f394f94 Remove unneded ctype.h everywhere
Add setlocale LC_TIME
1995-10-23 21:23:27 +00:00
ache
519d86dc6b Change LC_ALL to LC_CTYPE|LC_TIME - small optimization 1995-10-23 21:09:01 +00:00
ache
c525beefdf Add setlocale LC_CTYPE|LC_TIME 1995-10-23 21:06:31 +00:00
ache
44c7c30479 Remove unneded ctype.h 1995-10-23 21:03:40 +00:00
ache
319f1da108 Add setlocale LC_ALL 1995-10-23 20:36:26 +00:00
ache
c1cc65762e Add setlocale(LC_TIME,... 1995-10-23 20:26:53 +00:00
ache
33460f5501 Wrong library was picked by ed 1995-10-22 20:14:13 +00:00
joerg
4e0f66cc79 o rename ulimit -p into ulimit -u, so we are in agreement with bash
o fix brokeness for 1>&5 redirection, where `5' was an invalid file
  descriptor, but no error message has been generated

o fix brokeness for redirect to/from myself case
1995-10-21 00:47:32 +00:00
joerg
e988562d76 Implement the "ulimit" builtin. This is the analogon to csh's "limit"
command and badly needed in sh(1) for everybody who wants to modify
the system-wide limits from inside /etc/rc.

The options are similar to other system's implemantations of this
command, with the FreeBSD additions for -m (memoryuse) and -p (max
processes) that are not available on other systems.
1995-10-19 18:42:12 +00:00
joerg
56e0173839 Fix my breakage of the $0 handling during $ENV processing.
Since the broken version went into 2.1, this fix should, too.
1995-10-09 17:56:32 +00:00
bde
e9c97c811b Handle trailing slashes in source filenames correctly. E.g., rewrite
`mv foo/ ../..' to `mv foo/ ../../foo/', not to `mv foo/ ../../'.  The
latter caused a panic.  Before the trailing slash changes in the kernel,
the trailing slashes caused the rename() for this mv to fail earlier, so
there was no panic in 2.0.

Fixes part of PR 760.
1995-10-07 10:42:48 +00:00
markm
6bdec36c43 Correctly build the secure ed(1) only if secure/ exists.
Pointed out by:	bde
1995-10-03 15:44:50 +00:00
bde
243b088ed2 Preserve sticky bit for cp -pR'. It was already preserved for cp -R'.
This also fixes loss of the sticky bit for `mv' across file systems.
1995-10-03 12:55:01 +00:00
bde
9329cb6b3c Fix exit status. `cat no-such-file >/dev/null' exited with status 0.
This has been broken since cat's own err() function was sloppily
replaced by the library functions warn() and err().
1995-10-03 12:46:37 +00:00
joerg
c80589d3b0 Make the mkinit internal command issue an #undef for each #define, to
avoid "duplicate definition" warnings.
1995-10-01 15:13:31 +00:00
joerg
28020fbce3 Posixize:
sh  -c [-aCefinuvx] command_string [ command_name [argument ...]  ]        1

 4.56.3  Options

    -c          Read commands from the command_string operand.  Set the
                value of special parameter 0 (see 3.5.2) from the value of
                the command_name operand and the positional parameters
                ($1, $2, etc.) in sequence from the remaining argument
                operands.

Pointed out by: Kaleb Keithly (kaleb@x.org)
1995-10-01 15:11:42 +00:00
markm
78f711b914 Define CRYPTOBJDIR if secure is being built 1995-10-01 14:55:06 +00:00
markm
a00c541511 ed/Makefile is able to 'decide' for itself whether to build secure or
unceumbered ed. Remove the superfluous .if (...) / .endif
1995-10-01 14:24:01 +00:00
markm
05683329e7 Use the same make technique as passwd and xntpd for the secure ed(1). This
will allow the secure/bin/ed directory to be cleaned out and the bin/Makefile
to be cleaned up.
1995-10-01 14:17:29 +00:00
ache
e86c819403 Build secure ed if available and allowed 1995-09-29 19:31:55 +00:00
peter
69c296a7e8 Correct the alignment of the tty column, which was affected by my change to
allow more than two tty characters.

David Greenman pointed out that when a process that had been revoked from
it's controlling tty, the "-" sign was detached from any two-character
names.
1995-09-26 17:48:59 +00:00
mpp
fa60684197 Uncomment out references to FIFOs for the -F and -l options.
Also mention sockets in the text for -F.

Partially obtained from the NetBSD commit mail list.
1995-09-26 08:48:09 +00:00
bde
639631b078 Fix relocation of job table.
while { sleep 1 & wait; } do echo 1; done

corrupted the job table every 4th iteration.
1995-09-21 13:24:20 +00:00
dg
299dbda765 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.
1995-09-20 08:30:56 +00:00
pst
17129ca39c If mail is received with no from address, invoke sendmail with
/usr/sbin/sendmail -f <> dest
rather than
	/usr/sbin/sendmail -f dest.

Submitted by:  Michael Butler <imb@scgt.oz.au>
Obtained from: Eric Allman <eric@cs.berkeley.edu>
1995-09-16 18:52:51 +00:00
markm
8a8e624232 Updating /usr/include/kerberosIV/des.h so eBones will build breaks
rcp and rlogin.
(patch supplied)

Submitted by:  John Capo <jc@irbs.com>
1995-09-10 14:59:51 +00:00