Commit Graph

315 Commits

Author SHA1 Message Date
Peter Wemm 1018bd8d3c 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 Wemm 18e4c9579e 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 David 279de1f97b let the "exit" command return status when it is implicit 1996-09-08 03:12:22 +00:00
Peter Wemm 4e4e09596d 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 Wemm 4417f6297d 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 Wemm 16992ff483 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 Wemm 8a8c5e4e92 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 Wemm aa9caaf657 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
Wolfram Schneider b8923d4cc0 [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 David fb1000d678 set error status on exit, to be consistent with manpage and standard commands. 1996-08-27 21:51:48 +00:00
Wolfram Schneider 5a80fb277e sync copyright with /usr/share/examples/etc/bsd-style-copyright 1996-08-27 20:04:45 +00:00
Wolfram Schneider a09e5604c5 [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
Andrey A. Chernov c07cbf9cf8 Take out 0201-0207 range - those characters abused by sh 1996-08-12 22:14:50 +00:00
Andrey A. Chernov a1a0a1f9c7 Convert to newly added collate compare function 1996-08-12 21:32:15 +00:00
Andrey A. Chernov c906f8d406 Convert to newly added collate compare function 1996-08-12 19:31:11 +00:00
Andrey A. Chernov 917de9be32 Simplify expression 1996-08-12 12:31:28 +00:00
Andrey A. Chernov 072acff80a Use collate for alpha character ranges 1996-08-12 02:08:43 +00:00
Andrey A. Chernov b4814a03fc Fix unsetenv of locale variable 1996-08-11 23:10:38 +00:00
Andrey A. Chernov ba726b8a91 Localize it 1996-08-11 22:51:00 +00:00
Andrey A. Chernov 6e0d255e4b Pick collate info for RE character ranges 1996-08-11 16:59:27 +00:00
Andrey A. Chernov de727e7d02 Localize it
8bit cleanup
1996-08-11 16:48:11 +00:00
Adam David f3ad46f409 chmod(2) directories once only (was twice) 1996-08-10 15:05:26 +00:00
David Greenman dc01a4f714 Updated to match kernel changes for timer/run queue. 1996-07-31 09:27:23 +00:00
Wolfram Schneider 5df3108f6a add a reference to killall(1) 1996-07-03 22:19:50 +00:00
Mike Pritchard 3b818f3a1f 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
Mike Pritchard 157f653e98 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 Wemm 0164b6d61b 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 Wemm 0cd02d20a1 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
Jordan K. Hubbard cd9a2f5c28 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
Wolfram Schneider 0d917e0587 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
Poul-Henning Kamp bd6e0d9485 Backup yacc changes. 1996-06-02 17:06:40 +00:00
Poul-Henning Kamp fc15a73012 Backout yacc changes 1996-06-02 17:05:48 +00:00
Poul-Henning Kamp c959cc994a Use new yacc rules. (I'm fixing the tree as fast as I can :-) 1996-05-30 20:52:26 +00:00
Poul-Henning Kamp aa0e82cf5e Use default yacc rule. 1996-05-30 20:44:09 +00:00
Peter Wemm 9ec1e4b123 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 Wemm 069428af6d 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 Wemm 7d4b6187df 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
Thomas Gellekum de64b714f8 Output line count to stdout. Complies to POSIX.2.
Reviewed by:	joerg
1996-05-23 06:36:34 +00:00
Wolfram Schneider 9fb933075e ``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
Poul-Henning Kamp 00d17f40da CLSIZE -> getpagesize() 1996-05-02 13:06:21 +00:00
Poul-Henning Kamp 3a91de068c Replace NBPG with getpagesize() 1996-05-02 08:37:16 +00:00
Sujal Patel c01bf97c1e 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
Mike Pritchard e229ffb7e9 Correct some cross references and some path names. 1996-04-06 09:47:30 +00:00
Andrey A. Chernov 008ff22c41 For nonexisten time use proper diagnostic instead of bad format and usage 1996-04-06 01:42:09 +00:00
Andrey A. Chernov 3cb7c0b144 Use unsigned char for isprint 1996-03-31 16:14:11 +00:00
Bruce Evans bbb209f10c Fixed typo.
Reported by:	andreas@knobel.gun.de
1996-03-31 02:29:13 +00:00
Nate Williams 5883c5366b 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 Wunsch 9074ba2eea err() --> errx() for non-errno related failures. 1996-03-11 11:01:03 +00:00
Wolfram Schneider 6add522f93 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
Wolfram Schneider b0205aff7f 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
Wolfram Schneider aa05514818 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
Wolfram Schneider 5fd463ac12 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
Paul Traina 22471d5338 Don't initialize udata, fix usage string 1996-02-19 05:57:22 +00:00
Paul Traina ee4f505e5e Don't initialize udata, remove bogus case, fix usage string 1996-02-19 05:56:34 +00:00
Paul Traina 91e94a1d94 -- is implemented in getopt(3)
-? is an unnecessary case statement and not useful
1996-02-19 05:51:13 +00:00
Wolfram Schneider d7e0e5ca0f delete my last commit
Submitted by:	pst, ache
1996-02-19 00:44:19 +00:00
Paul Traina daf6f1eb4e Remove unnecessary '?' case and don't zero global udata, it's already zero 1996-02-18 19:54:04 +00:00
Wolfram Schneider f44290853f update usage string
all flag variables initialized with zero
respond `Y' is equal to `y'
1996-02-18 19:00:59 +00:00
Wolfram Schneider d6ea04ccf4 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
Wolfram Schneider 1efb053dc4 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 Wunsch 825e82efc8 Add an .Xr for chflags(1) into the SEE ALSO sectoin.
Submitted by:	jhs
1996-02-16 00:08:53 +00:00
Mike Pritchard 3656c5f4df 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
Mike Pritchard 78b0b234eb 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
Mark Murray bbff7ca556 #include <kerberosIV/des.h> -> #include <des.h> 1996-02-11 09:18:18 +00:00
Paul Traina a03b5a5efb Close bin/937 - handle negative timestamps 1996-02-08 21:06:40 +00:00
Joerg Wunsch 0f9a535124 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
Mike Pritchard f3c0267f19 Fix some incorrect locations in the FILES sections of some man pages. 1996-02-02 18:22:04 +00:00
Mike Pritchard 7d7ee86eb7 Fix some spelling errors. 1996-01-29 22:53:24 +00:00
Mike Pritchard b2496d93eb 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
Mike Pritchard 8564f3402c 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
Bruce Evans 51ea8b57b8 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 Wemm d007c60359 oops. I forgot to add the "[-U username]" option to the usage string. 1996-01-12 08:49:43 +00:00
Peter Wemm 6065a0be11 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 Wunsch df2fbf15a2 Print dev minor #'s > 255 in hex.
Reviewed by:	jkh, kuku, phk
1995-12-30 18:15:30 +00:00
Joerg Wunsch 1c0c773193 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 Wemm 73eb8310a9 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
Bruce Evans 7fdb7bc891 Restored formatting from the old printf/printf.c. 1995-12-14 23:19:36 +00:00
Joerg Wunsch 454bd7b924 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 Wunsch d9f9371008 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 Wunsch 717252ea98 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 Wemm 8d7d5ceaa5 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
Bruce Evans 0fe788e3e8 Fixed descriptions of ignpar and parmrk. 1995-11-11 03:31:13 +00:00
Peter Wemm 8f08f33ed9 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
Poul-Henning Kamp 8b9b0e39a7 I add #include <sys/user.h> 1995-10-28 20:11:18 +00:00
Andrey A. Chernov 25c3d35121 Fix -h option:
sense symlink even it is unresolved
1995-10-28 11:54:42 +00:00
Andrey A. Chernov 2bf4b9cf1f Change local to LC_ALL, there is no bitmask 1995-10-26 10:57:52 +00:00
Andrey A. Chernov f5bd01c69e Change locale to LC_ALL, there no bitmask 1995-10-26 10:56:38 +00:00
Torsten Blum 59f0c0d522 fix bad dependencies (LIBMATH -> LIBM) 1995-10-25 15:08:21 +00:00
Andrey A. Chernov fb241711f7 Add missing reaction on LC_ALL and LC_COLLATE 1995-10-23 23:08:26 +00:00
Andrey A. Chernov f7c627b282 Add setlocale LC_CTYPE 1995-10-23 21:31:48 +00:00
Andrey A. Chernov c2ad0566d6 Remove unneded ctype.h everywhere
Add setlocale LC_TIME
1995-10-23 21:23:27 +00:00
Andrey A. Chernov 1d06ee4a64 Change LC_ALL to LC_CTYPE|LC_TIME - small optimization 1995-10-23 21:09:01 +00:00
Andrey A. Chernov 0c56c7b29c Add setlocale LC_CTYPE|LC_TIME 1995-10-23 21:06:31 +00:00
Andrey A. Chernov 5b28d45420 Remove unneded ctype.h 1995-10-23 21:03:40 +00:00
Andrey A. Chernov a409ec1917 Add setlocale LC_ALL 1995-10-23 20:36:26 +00:00
Andrey A. Chernov 4d279a0648 Add setlocale(LC_TIME,... 1995-10-23 20:26:53 +00:00
Andrey A. Chernov afceae0c47 Wrong library was picked by ed 1995-10-22 20:14:13 +00:00
Joerg Wunsch 769bbc65e8 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 Wunsch 7a2afe644c 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 Wunsch 3d434cfb15 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