Commit Graph

1051 Commits

Author SHA1 Message Date
peter
d5875ff951 Initial kenv(1) hack for dumping the kernel environment. This can be
used to extract modified boot hints to make loader(8)-time changes
"sticky".  It tries to use \ style quoting so that it can be used directly
with foo.conf files.  It can also extract specific variables.
2000-07-08 08:33:40 +00:00
will
a9f5ed66a5 Fix the exit code for the case where nentries == 0; if a PID doesn't exist,
ps(1) should not be returning a success code (0), it should return an
error code (1).  This was fixed on OpenBSD over 3 years ago.

PR:		19069
Submitted by:	Jim Sloan <odinn@atlantabiker.net>
Reviewed by:	rwatson
2000-07-08 05:13:10 +00:00
sheldonh
590c7071c0 Explain the dependence of colour support on the capabilities of the
terminal emulator.

As pointed out by jhb, a more scalable solution would be preferable
when multiple applications in the base system begin linking against
libh.

Submitted by:	Doug Barton <DougB@gorean.org>
2000-07-07 14:46:13 +00:00
ache
64c50a727c restore tabs lost from prev commit
Asked-by:	bde
2000-07-07 08:27:59 +00:00
ache
fe87131f45 curses -> termcap, mainly for purity and to indicate which functions family
really used
2000-07-06 22:05:41 +00:00
assar
cc82809e07 make sure we do not write out non-printable characters in file names
and symbolic links (by default)

PR:		bin/19354
Reviewed by:	silence on -current
2000-07-04 23:09:23 +00:00
green
bce0f7f785 Various cleanups are made to reduce warnings and make code prettier :)
Also, check for ftruncate() return value and die on failure, but only
try to ftruncate() when the file is a regular file.
2000-07-01 05:36:25 +00:00
nbm
a5952908d6 Fix the rmdir -p a/b/c/ case, where rmdir -p a/b/c works, and rmdir c/
works.

PR:		PR 6521
Submitted by:	Rudolf Cejka <xcejka00@dcse.fee.vutbr.cz>
Reviewed by:	eivind (in brief retrograde)
2000-06-28 14:54:07 +00:00
mpp
3ce8cc6dcb Grumble. The previous commit still had the wrong date in the
example.  Oct 29 0:30 +3 hours is still Oct 29, no matter what the
DST setting is, and not Oct 30..
2000-06-28 09:20:06 +00:00
mpp
acfb873a66 Typo fix.
PR:		docs/19554
Submitted by:	Kazuo Horikawa <horikawa@psinet.com>
2000-06-28 09:13:32 +00:00
sheldonh
4fa5c230c7 Use Dq Li (double-quoted literal) instead of Ic (internal command) to
mark up a sample invocation, since it is not a command internal to the
described utility.

Do not use Ar (argument) to mark up something which is not an argument
to the utility or one of its internal commands.
2000-06-27 18:22:13 +00:00
mph
c859f71bc9 Add \a and \e to "echo -e" escape handling. 2000-06-26 22:43:30 +00:00
ache
6efdb32a4d Use %Ef 2000-06-22 16:57:39 +00:00
sheldonh
83dacededb Fix changes from 1.34 through 1.37:
Remove newly added hard sentence breaks.
Mark ANSI up as a type name (Tn).
Avoid parenthesized sentences and paragraphs.
2000-06-22 10:07:46 +00:00
brian
13676cf486 Mention the timezone where appropriate (for the -v option).
correct one of the -v options.
2000-06-22 10:02:33 +00:00
joe
67bdfbbb94 Order the ENVIRONMENT section alphabetically. 2000-06-21 21:56:50 +00:00
joe
e0a33989f0 I broke locale sensitive ordering of date and month in
the long -l output format with the last commit.  Fix it
by replacing the "%b %e" strftime format with "%Ef".

Make a note in the manual page that the LANG environment
variable affects the running of ls.

Reviewed by:	ache
2000-06-21 21:49:57 +00:00
joe
90fe0cb3dd Don't assume that the output of strftime for "%c" ("national
representation of time and date") won't change in time.  Instead
of hard coding the locations of the time elements and hoping that
they don't move use strftime to generate the desired formats in
the first place.

PR:	bin/7826
2000-06-18 22:18:04 +00:00
joe
d38d9a6248 Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
ache
33a9fbbc76 Activate Japanese NLS and KANJI support 2000-06-11 03:26:08 +00:00
ache
2c6f62e2ff Fix one conditionalization in my prev. commit 2000-06-06 13:02:52 +00:00
ache
08693c6a2b Greately simplify oxtabs fix by simple setting f_notabs for f_color 2000-06-06 12:44:29 +00:00
ache
810473589e Honor f_notabs flag even in COLORLS 2000-06-06 12:25:17 +00:00
ache
9f1fa71919 Back out spaces to TABs replace removing for COLORLS
Rewrite corresponding comment to say what happens in reality with oxtabs
and current terminal column.
2000-06-06 12:10:07 +00:00
ache
307c56dfb9 Don't replace TABs with spaces for COLORLS because "some terminals get confused"
as comment says. I know no terminal confused by this. If even such terminal
exists, it must be termcap flag for this, not hardcoded in ls.
2000-06-06 07:32:20 +00:00
ache
a24c251a9b Add -G to usage: if COLORLS 2000-06-06 07:29:43 +00:00
ache
0f2a313fa4 Staticize more functions 2000-06-06 07:19:50 +00:00
ache
943a6e1adc Move colorquit() prototype to extern.h
Add "extern" to variables declarations in extern.h to not make them
commons into each compiled file.
2000-06-06 07:14:01 +00:00
ache
5355834dc4 Make signal handler safe - don't use stdio (pointed by bde)
Staticize some color functions
Add yet one tolower() call which is forgotten after check
Don't check for OOPS - not really needed
2000-06-06 06:52:03 +00:00
ache
15b03c2538 Reflect reality:
yellow -> brown
white -> light grey
2000-06-06 00:42:24 +00:00
ache
6272adc2a1 Get rid of curses completely - use tgoto instead of tparm 2000-06-05 20:54:46 +00:00
cracauer
3a80c33829 Do SIGINT cleanup for SIGQUIT as well. 2000-06-05 20:38:47 +00:00
ache
6536a3f105 Kill yourself in ^C handler, not exit(1) to allow script to sense signal 2000-06-05 20:08:50 +00:00
ache
00dd68e3d7 Cosmetique of prev. optimization - don't use global variable 2000-06-05 19:56:52 +00:00
ache
2a5d3aa5b1 Don't use curses includes, include termcap.h instead
Don't use curses functions, use tputs instead
Add ^C reaction - reset colors
Optimization - don't turn off colors after EACH file printed.
Fix wrong ctype macro arg type in LSCOLORS parsing
2000-06-05 19:39:39 +00:00
ache
a8edda659f Don't use curses includes, include termcap.h instead
Add ^C reaction set
2000-06-05 19:36:06 +00:00
ache
0468aeeaa9 Don't use ncurses, use termcap
Add DPADD
2000-06-05 19:34:31 +00:00
joe
ab86341fa6 Don't look up the ANSI sequences each time a colour is changed,
this is extremely inefficient, instead write them all down at the
beginning.

The correct sequence to switch colours off is to first use 'op' if
it exists, otherwise use 'oc'.  If neither of these exist then we
shouldn't be doing colour with this terminal.

Reviewed by:	ache
2000-06-05 03:51:29 +00:00
joe
59ff4f2789 Disable colour support in ls when building the fixit floppy, and make
a note of it in the release Makefile.
2000-06-05 02:25:55 +00:00
joe
613e5ba349 * Re-implement colour support using termcap's AF and AB capabilities
to manage the ANSI colour sequences.  Colour support is disabled
  unless the TERM environment variable references a valid termcap.

* Allow optional compilation of the colour support in the Makefile,
  defaulting to yes.  This allows us to switch it off for fixit
  floppies and other mediums where space is an issue and the extra
  bloat of statically linking with ncurses isn't acceptable.

* Display a warning if colour is requested with '-G' but support
  for it isn't compiled in.
2000-06-05 02:14:01 +00:00
jwd
3c862d2c44 Add -g for gigabyte sizes.
Approved by:	jkh
2000-06-03 20:17:39 +00:00
joe
94644071d6 Add colour support to /bin/ls (at a cost of 1056 bytes on my system).
It is not switched on by default and must be enabled with the -G
flag.  When using ls -G the output behaviour is modified with ANSI
colour sequences wrapped around filenames to help distinguish file
types.  (Colours can be redefined in the LSCOLORS environment
variable as described in the manual page.)

Colour support is silently disabled (if switched on) if stdout
isn't a tty.

Based on:	asami's colorls port.
PR:		bin/18900 && ports/18616.
2000-06-02 14:53:42 +00:00
obrien
e8074be4b3 Fix ``dd if=/dev/zero of=/dev/daN'' on the Alpha by allowing the label
to be overwritten.

Submitted by:	green
2000-05-24 06:47:10 +00:00
brian
2637bd1196 Propogate the ``call mktime'' flag from adjwday() down to adjday().
Submitted by: Christian Weisgerber <naddy@mips.inka.de>
2000-05-23 23:58:18 +00:00
dbaker
dc5f566f2b Correct confusion and differentiate appropriately between GMT and UTC when
date is launched with the "u" argument.  It now operates in the documented
manner.

Fix typo in date man page.

Submitted by:	David McNett <nugget@slacker.com>
2000-05-19 18:02:25 +00:00
obrien
5b76cb9de0 In its current state, this file is no longer needed. 2000-05-15 17:50:38 +00:00
bde
5c36208659 Don't forget to clean csh.1.
Fixed some style bugs.
2000-05-15 14:24:32 +00:00
cracauer
41dfb7ba25 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
52da0fced7 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
sheldonh
ea43758f6a Supply only one author name per instance of %A, as per mdoc.samples(7).
PR:		18465
Submitted by:	Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
2000-05-10 09:49:04 +00:00
sheldonh
5e0dc361bb Fix miscellaneous mdoc macro argument limit infringements.
PR:		18465
Reported by:	Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
2000-05-09 14:02:06 +00:00
kris
4b5eb94748 Remove test for block device. 2000-05-07 08:56:21 +00:00
jkoshy
5cfaeab905 Install a manual page for `tcsh(1)', for completeness.
Approved by:	obrien
2000-05-05 08:12:11 +00:00
asmodai
888d579612 Remove unused #include. 2000-05-01 18:34:36 +00:00
joe
095681660c Fixes a potential buffer overflow with 'ed [MAXPATHLEN + 1 characters]'.
Submitted by:	Mike Heffner <spock@techfour.net>
Submitted on:	audit@freebsd.org
2000-04-30 20:46:14 +00:00
ache
b6ec16ff93 Fix warn format
Pointed-by: bde
2000-04-30 17:12:49 +00:00
ache
24d1eb8e5f Back out all drainwait changes. It is enough controllable via sysctl or
comcontrol, having it in stty cause too many problems with existing drivers
and tty access permissings of non-superuser.

Asked-by: bde
2000-04-30 17:04:26 +00:00
ache
408144e1b5 gfmt: set drainwait only if changed
It allows to restore tty state without a warning for non-superuser
2000-04-30 16:22:09 +00:00
ache
e7b1166a35 Describe drainwait 2000-04-27 22:08:29 +00:00
ache
56d7e97f31 part of gfmt really changed commit 2000-04-27 21:48:48 +00:00
ache
f61af6309a gfmt: set 'changed' flags only if something really changed. 2000-04-27 21:45:41 +00:00
ache
1c00526cf7 Add ability to manipulate with drain wait time 2000-04-27 21:31:23 +00:00
ache
524b4d932b Activate ja nls if WANT_KANJI
Fix 'make release'
Suppress 'make distribute'
2000-04-24 08:14:16 +00:00
obrien
693ac85cf0 Pass "WANT_KANJI" from make.conf to the compiler. 2000-04-23 18:08:49 +00:00
obrien
86198ed6c9 MBYTEDEBUG not needed for "WANT_KANJI"
Submitted by:	Hajimu UMEMOTO <ume@mahoroba.org>
2000-04-23 18:08:10 +00:00
obrien
fe67f768fb Until it's impact is better understood, only active KANJI/DSPMBYTE/MBYTEDEBUG
if "WANT_KANJI" is defined in /etc/make.conf.

Submitted by:	Hajimu UMEMOTO <ume@mahoroba.org>
2000-04-21 18:45:06 +00:00
ache
088861cd52 Fix 'make distribute' 2000-04-21 12:34:41 +00:00
ache
af8fee5cf1 Disable ja NLS until clarifying what needed else to support it 2000-04-21 10:14:09 +00:00
cracauer
bb4531b545 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
8ea163616a 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
931eca6c86 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
ache
7d473202b3 Activate NLS.
Optimize NLS by not wasting space copying the same .cat but use symbolic links
instead.
2000-04-20 08:58:11 +00:00
ache
f99ac9fa4b Activate finnish set 2000-04-20 07:08:43 +00:00
obrien
44019dcdc4 Add NLS files. Finish and Greek are WIPs.
Submitted by:	ache
2000-04-20 06:50:23 +00:00
obrien
8068c128fb Use our system malloc(). 2000-04-19 15:15:44 +00:00
obrien
fb1f33928b Install /bin/tcsh also. 2000-04-19 15:15:19 +00:00
obrien
c17873d359 Upgrade csh. 2000-04-18 07:31:36 +00:00
obrien
1adf7545b6 Add a NO_TCSH knob. 2000-04-17 20:32:13 +00:00
asmodai
4f65b6759d Sync us up to OpenBSD's cat.1 v1.18 and cat.c v1.9.
This gets rid of a bogus cast of NULL in setbuf().
Lets us know the buffer malloc failed.

Reworks the manpage a bit to make it more mdoc(7) compliant, adds
examples.
2000-04-14 21:01:35 +00:00
imp
751eca007c Use #include <errno.h> rather than extern int errno;. 2000-04-14 06:03:39 +00:00
asmodai
1ce15de0f3 Remove unnecessary empty line.
Remove trailing whitespace.
2000-04-13 19:31:46 +00:00
brian
0883c48a66 Change -v so that variences in units of days or less are sensitive to
DST.  Explain in more detail what date -v does when mixed with DST.

Previous code suggested broken by: wollman
2000-04-12 13:35:17 +00:00
brian
2c7efd406c Always give mktime a timeval with tm_isdst set to -1, otherwise
things get a bit out-of-phase when we step backwards 1 hour from
between 0:00 and 1:00 on the first of the month following the
transition into Summer time.  This is probably actually a bug
in mktime().

PR:	10963

If mktime() fails and 68 < year < 138, assume that the reason is
because of Summer time and adjust up or down according to our
adjusting context by one hour.  This assumes that all DSTs are
multiples of 1 hour.

PR:	6223, 17750
2000-04-05 01:59:36 +00:00
bde
76860644ae Fixed prototype for setflags(). setflags() returns int, not u_long,
and "extern" in function prototypes is a style bug.  The type mismatch
broke chflags(1) on i386's with 64-bit longs and may have broken it on
alphas.
2000-04-04 14:12:35 +00:00
jdp
375ea71f6b Document that the flags can be specified as an octal number. 2000-04-03 22:10:58 +00:00
bde
3cc73bd7ca Fixed LDADD. Using ${LIBM} instead of -lm gave the wrong libm in most
cases and broke the world in some cases.

Fixed some style bugs (the usual ones for DPADD and LDADD, misplacement
of DPADD and LDADD, and misplacement of $FreeBSD$).
2000-03-27 14:53:26 +00:00
sheldonh
2c584f634f Correct confusing description of the -r option.
PR:		17250
Submitted by:	cjclark@home.com (Crist J. Clark)
2000-03-07 20:54:17 +00:00
sheldonh
e3ca50a712 Revert the previous commit. I knew I should leave non-mdoc stuff alone. 2000-03-03 09:53:52 +00:00
sheldonh
c0e8952a50 Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
sheldonh
247d8e4828 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 11:34:08 +00:00
sheldonh
8b9d0d56e2 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 10:43:09 +00:00
green
46bb443af0 After Bruce kindly explained the whole groff "sentence" idea to me, I've
put the whitespace in the right place.
2000-03-01 05:28:45 +00:00
markm
c92558714d Change DISTRIBUTION name to match reality. 2000-02-29 11:39:24 +00:00
green
644fd26c68 Fix style bugs I introduced in the last revision.
Brucified by:	bde
2000-02-27 16:40:39 +00:00
green
3921e6ea29 Add iseek= and oseek= aliases for the preexisting skip= and seek=
operands.  Can _YOU_ tell skip= and seek= apart with 100% accuracy
every time?

This also seems to make us option-for-option compatible with the
Solaris dd(1).

Approved by:	jkh
Suggested by:	peter
2000-02-26 21:29:44 +00:00
markm
85a606a0dc Use libcrypto inst=ead if libdes. 2000-02-24 21:21:15 +00:00
alfred
0b348be5fc Re-add "May" to the list of dates supported.
Approved by: jkh
2000-02-18 23:41:45 +00:00
gsutter
575e32d8e0 Reflect that dd accepts octal and hexadecimal numbers (in addition to decimal).
PR:		16750
Submitted by:	Giorgos Keramidas <keramida@ceid.upatras.gr>
2000-02-18 04:55:40 +00:00
unfurl
9945021df6 From the PR:
The description of -X option in csh(1) manpage uses a wording
  that references the descriptions of -x, -v and -V.  This might
  be a little confusing.  Changed this to a complete description
  that does not reference other paragraphs.

PR:		16762
Submitted:	Giorgos Keramidas <keramida@ceid.upatras.gr>
2000-02-17 03:40:21 +00:00
unfurl
d3ad67143c From the PR:
The first paragraph of "Argument list processing" says that an
  argument of - will make csh be a login shell.  However, running
  csh with only a - as an argument fails with the error message.

csh(1) corrected to reflect this.

PR:		16754
Submitted by:	Giorgos Keramidas <keramida@ceid.upatras.gr>
2000-02-17 03:23:39 +00:00
unfurl
41a5ad6012 From the PR:
Three minor changes to the manpage of chmod(1).

  1. At the description of -H option, I added that symlinks are
  not followed _by default_ to show that links can be followed,
  but the default chmod behavior is not to do so.

  2. Moved a misplaced .Va file command up to the place it belongs.

  3. Simplified the grammar that describes symbolic modes.

PR:		16749
Submitted by:	Giorgos Keramidas <keramida@ceid.upatras.gr>
2000-02-17 03:17:03 +00:00
cracauer
84e2d3d400 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
joe
bb1bbb6d1f Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.

Additionally there were complications with the build/install-world
process.  It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.

There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).

It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.

Approved:	jkh
2000-02-05 18:42:36 +00:00
peter
be43d8fdca Don't report the tablet line discipline, it "doesn't happen (TM)" 2000-01-29 16:44:08 +00:00
joe
a3a381812b Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'.  As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes:  setmode and getmode.  In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)
2000-01-27 21:17:01 +00:00
mharo
2e370fe4cc fix cp -vi bug
Submitted by:	Dan Papasian (bugg_ on irc)
2000-01-23 03:04:49 +00:00
brian
3ef6524e98 Fix various mandoc bugs 2000-01-12 00:29:16 +00:00
phantom
7903e5d189 Add `.Nm red' to NAME section. 2000-01-10 12:20:30 +00:00
phantom
a9d70c7d83 . mdoc(7)'fy
. add Xrs to hosts.equiv(5), auth.conf(5), services(5) to some pages
. sort Xrs in SEE ALSO sections

Patches based on PR:	docs/15680
Submitted by:		Christian Weisgerber <naddy@mips.rhein-neckar.de>
2000-01-07 13:14:32 +00:00
bde
637d61ef0c Print negative minor numbers in hex. Negative minor numbers are
essentially large unsigned ones, and we already print minor
numbers > 255 in hex.
2000-01-06 14:40:10 +00:00
bde
00c594d838 Actually remove unrequired SRCS. 2000-01-05 19:22:10 +00:00
joe
f6504eea50 Added missing DPADD's. Removed unrequired SRCS's.
Obtained from:	bde
2000-01-01 15:44:11 +00:00
joe
fc177b5033 Removed bogus dependancy on libutil.
Noticed by:	bde
2000-01-01 15:40:40 +00:00
joe
b318598993 Retire stat_flags.c; it's now in libutil. 1999-12-30 13:23:34 +00:00
joe
e1558fa7cb Moved flags_to_string and string_to_flags into libutil. It's used in
many places nowadays.
1999-12-30 13:15:15 +00:00
sheldonh
e519d76ecd Back out previous commit and replace with a cleaner solution adapted
from the source attributed below.  In particular, this removes a goto
inside a switch and replaces those horrendous ATOI macros with
something acceptable.

More clean-ups to come.

PR:		bin/14151
Reported by:	Christian Weisgerber <naddy@mips.rhein-neckar.de>
Obtained from:	NetBSD
1999-12-29 16:50:08 +00:00
sheldonh
3fa2c380e4 Take into account the fact that "[" may be called with a path,
for example "/bin/[".

Reported by:	Vlad Skvortsov <vss@ulstu.ru>
Reported by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
Message-Id:	99Dec27.111307est.40321@border.alcanet.com.au
1999-12-28 09:34:57 +00:00
jhb
e581e4d408 Mention the hostname variable in /etc/rc.conf since that is the most
common way of setting the hostname.  The man page already mentioned that
the hostname is set by /etc/rc.network, so this just explains where
/etc/rc.network gets the hostname from.

PR:		docs/14319
Submitted by:	rwatson
Reviewed by:	cmc
1999-12-22 01:28:49 +00:00
roberto
5d593558fb Fix a bug where a pointer would be one character too far after putting
a '\0' at the end of a string.

Submitted by:	Martin Birgmeier <Martin.Birgmeier@aon.at>
1999-12-21 10:17:36 +00:00
sheldonh
e4586fe222 Fix cut'n'paste niggles in previous commit. 1999-12-21 08:57:58 +00:00
sheldonh
a16eee301a Add link(1) and unlink(1) as special cases of ln(1) and rm(1)
respectively, in accordance with SUSv2.

This differs from the approach taken in NetBSD, but provides
less obscure error messages in at least the EISDIR case and
does not take up additional disk space for new binaries.

PR:		13071
PR:		13074
Requested by:	James Howard <howardjp@wam.umd.edu>
1999-12-20 16:13:47 +00:00
cracauer
5b96e1fbb2 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
roberto
7e9f2214cc Rewriting of flags_to_string() and string_to_flags() to use an array.
PR:		bin/3648
Submitted by:	Martin Birgmeier <mbirg@austria.ds.philips.com>
1999-12-19 15:31:24 +00:00
cracauer
c225fa62bc Second part of 8-bit fixes. 1999-12-16 12:03:46 +00:00
cracauer
b5bf73dc9e Document ulimit -b for RLIMIT_SBSIZE. 1999-12-15 16:12:32 +00:00
cracauer
4cbc981dd7 First round of 8-bit fixes. 1999-12-15 11:46:32 +00:00
mharo
9b0a89b259 add human readable output (-h and -H)
Obtained from:	parts of human readable code from OpenBSD
Reviewed by:	obrien

add POSIX, byte and megabyte block size ouput flags

PR:		13579 (POSIX flag)
Submitted by:	Mike Meyer <mwm@phone.net>
1999-12-15 03:44:09 +00:00
green
1fd819e3ea I've been Brucified! I did evil things with typedefs, but I'll do it
the correct (but less aesthetic) way, now.  New lesson: correctness
and aestheticity may be mutually exclusive at times.

Brucified by:	bde
1999-12-08 02:44:46 +00:00
green
9caf6bd1bb Do proper constification in args.c. This shuts up -Wcast-qual (thanks,
bfumerola for that pointer!) in GCC complaining about losing a const.

While I'm here, might as well mark in the Makefile that I'm the
${MAINTAINER}.  It seems like that's what everyone's doing these days.
1999-12-07 03:32:37 +00:00
cracauer
0dc63ece3e make '|' character visible.
PR:		docs/15265
Submitted by:	takamune@avrl.mei.co.jp
1999-12-05 12:13:54 +00:00
cracauer
a98edd94ad Fix "subscript has type `char'" warnings by casting to int, as
discussed on -arch.
1999-12-04 17:12:47 +00:00
cracauer
fc301cf926 Include strerror(errno) in error messages after failed system calls.
Fix a warning.
1999-11-29 19:11:01 +00:00
obrien
ad8435642d Default to not -v.
Fix usage() style bug spotted by BDE.
1999-11-28 12:24:16 +00:00
mharo
7e22d49a6b brucify
Reviewed by:	obrien
1999-11-28 09:34:21 +00:00
obrien
aac66aa6db Add "-v". 1999-11-27 19:25:08 +00:00
charnier
8d7a247695 Correct use of .Nm. Add DIAGNOSTICS section. Add rcsid 1999-11-21 16:11:56 +00:00
sheldonh
f0d9fc91a6 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
8466bd4840 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
peter
938bef9779 I'm probably jumping the gun, but what the heck, this is -current.
Turn off setgid-kmem for /bin/ps, it's now quite functional without it.
ps no longer needs /dev/*mem or /proc.  (It will still use some /proc
files if they are available for -e, but it's not required, so it'll
happily run in a jail or chroot).

The proc stats are now part of eproc (obtained via sysctl) and no longer
needs to beat up the u-page reading code and the problems with that.

This also has the side effect of disabling 'ps -e' for normal users
*EXCEPT* when looking at their own processes.  ie: they can see
environments in processes with their uid, enforced by the ownership of
/proc/*/mem.  Root can still see them all, as it can open all /proc/*/mem.
1999-11-17 13:37:30 +00:00
peter
0f063714b6 Use eproc.e_stats, not a series of crude hacks to fetch it from the u-area.
Also, fix some indentation that got messed up somehow..
1999-11-17 12:52:42 +00:00
phk
9e8e07135f Introduce commandline caching in the kernel.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.

To disable this facility and revert to previous behaviour:
        sysctl -w kern.ps_arg_cache_limit=0

For full details see the current@FreeBSD.org mail-archives.
1999-11-16 20:31:58 +00:00
kris
66eb9e9f62 Typo (appropiate -> appropriate)
Obtained from:	OpenBSD (inspired by)
1999-11-15 03:37:57 +00:00
sheldonh
69829abb31 Allow the year to be specified with an optional century.
PR:	14472
Reported by:	j_guojun@lbl.gov (Jin Guojun)
1999-11-10 13:34:39 +00:00
sheldonh
29b4f4c077 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
cdd2be8eed 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
2345f37a15 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
julian
dc696666cc Most modern OSs have the ability to flag certain mounts as ones to
be ignored by default by the df(1) program.  This is used mostly to
avoid stat()-ing entries that do not represent "real" disk mount
points (such as those made by an automounter such as amd.)  It is
also useful not to have to stat() these entries because it takes
longer to report them that for other file systems, being that these
mount points are served by a user-level file server and resulting in
several context switches.  Worse, if the automounter is down
unexpectedly, a causal df(1) will hang in an interruptible way.

PR:		kern/9764
Submitted by:	Erez Zadok <ezk@cs.columbia.edu>
1999-11-01 04:57:43 +00:00
ru
77db7a0b81 Restore reference to sleep(3). 1999-10-28 17:41:33 +00:00
cracauer
484b3d2fe4 Fix ';' command when used with -e flag.
PR:		bin/14509
1999-10-26 13:17:18 +00:00
obrien
4f29e82105 Add `n' to the synopsis.
Forgotten by:	sheldonh
1999-10-16 16:17:54 +00:00
green
7c735c4220 Implement ulimit -b for RLIMIT_SBSIZE. 1999-10-09 20:56:06 +00:00
green
4899b61a6b This implements the RLIMIT_SBSIZE ("sbsize") administrative limits for
userland.  Currently, it can be enforced by login and csh.  More
shells supporting sbsize are welcome.
1999-10-09 20:47:59 +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
green
70e3f01794 Nuke the FIODTYPE compatibility bits. It's time. 1999-10-03 18:49:51 +00:00
ru
cfe4670921 Let sleep(1) handle fractions of a second (up to nanosecond).
This is a conservative change.  It does the same thing in weird
cases like the old one.  For example, 'sleep abcd' still sleeps
for zero seconds.  `sleep 10.a' and `sleep 10.05aa' do the best
and not abort (ie: 10.a == 10 seconds, 10.05a == 10.05 seconds).
1999-10-01 07:53:40 +00:00
markm
f5d1994712 Fix for new Kerberos4. 1999-09-19 22:11:15 +00:00
green
9537448176 Make count=0 set cpy_cnt to -1, which is slight overloading, but makes
what I was trying to do work much better (ie at all.  I could have sworn
it was working...) Fix a SEEK_SET to be SEEK_CUR, and make Bruce's
lseek() test work correctly.
1999-09-16 19:50:59 +00:00
green
71e6301112 Let count=-something fail, while count=0 may succeed, thus making dd(1)
useful as a seeking-tool as well as its many other uses.  Previously,
dd(1) would succeed with count=0, but wouldn't get to the point that
blocks were to be read/written. This is a more useful behavior, and
this specific case doesn't seem to be handled by POSIX.
1999-09-16 05:12:59 +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
green
35b43c7556 Even more dd(1) cleanups! Thanks to Bruce for staying on my case until
we're done (not yet!) :)
1999-09-13 21:47:10 +00:00
phantom
852722152f Fix SEE ALSO section:
. add printenv(1)
. correct reference to "CSH introduction"

Reviewed by:	mpp
1999-09-13 19:16:47 +00:00
bde
45610c66ad Fixed longstanding breakage of rm of deep directories in rev.1.2.
rm must not use FTS_NOCHDIR, since chdir'ing is required for removing
deep directory trees and the ability to remove such trees is required
by POSIX.2 and POLA.  The breakage didn't make much difference until
recently, since fts(3) didn't work in deep directory trees.  It isn't
clear whether using FTS_NOCHDIR ever fixed anything (Net/2's rm.c is
similar to Lite1's).  Perhaps it was actually to limit the damage
caused by the fts bug.
1999-09-13 15:12:30 +00:00
green
6ee6f36b23 ISDISK -> ISSEEK
Allow a device type of D_DISK or D_MEM to be ISSEEK.
1999-09-12 18:56:12 +00:00
green
8ec9b18502 Even more cleanups to dd(1). This is probably the culmination of the
BDEification process of dd(1). Most of the changes are from BDE's archive.
Support for negative offsets is gone again, but the case where you
lseek() onto byte -1 of something from a negative offset using seek/skip
is fixed; if you end up on -1, you won't get a false positive lseek failure.
  The biggest changes are to data types (more size_t, for instance) and
argument parsing. skip/seek on /dev/{,k}mem now occurs (instead of "read
until you reach the offset") due to mem devices now being D_DISK. Some
const things are now correctly declared as such, and the "case table"
building is better. The only thing that seems to be left to make dd(1)
everything TOG wants it to be is l10n.
1999-09-12 16:51:53 +00:00
obrien
000097e93e Add verbose processing flag. 1999-09-11 10:06:56 +00:00
green
8ab8f219b1 Make a bit more headway with dd's argument parsing, etc. get_bsz() is
renamed get_num() since it's not just about block sizes. skip and
seek can be any offset, including negative, now. Some style bogons are fixed.
1999-09-11 00:02:42 +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
mharo
281ecd6252 brucify, v' before W', mention -v is non-standard in manpage and
make code slightly easier to read

Reviewed by:	obrien
1999-09-04 03:40:10 +00:00
mharo
d516d4a439 mention that -v is non-standard
Reviewed-by:	obrien
1999-09-04 03:33:18 +00:00
mharo
1fbe854d9a brucify and add comment about -v being non-standard to manpage
Reviewed by:	obrien
1999-09-04 03:19:38 +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
bde
84fc24eb00 Yet another previously forgotten merge from Lite2. (Describe
`opaque', fix reversed description of `nodump', and don't use
`nodump' as an example of adding a `no' prefix since the double
negative would be confusing (it's still confusing -- the implicitly
documented `nonodump' flag doesn't exist).)
1999-08-30 03:40:26 +00:00
mharo
c6d21f8ff9 fix rm -r
Submitted by:	John Hay -- John.Hay@mikom.csir.co.za
1999-08-29 19:57:03 +00:00
mharo
eea1ad0aa4 add verbose flag 1999-08-29 08:21:16 +00:00
mharo
779ca8c356 brucify and move printf() to catch cases of special files 1999-08-29 07:58:19 +00:00
mharo
7f61632b5b add verbose flag
exit(1) --> exit(EX_USAGE)

Reviewed by:	obrien
1999-08-29 02:20:26 +00:00
mpp
9d8b3b4e1b Fix typo in previous commit that documented the -v option. 1999-08-28 21:38:36 +00:00
mharo
94c239d059 add verbose flag
Reviewed by:	obrien
1999-08-28 20:46:00 +00:00
green
e751e53319 Relax things a bit. Not having FIODTYPE will be a warning for now.
Pointy hat:	green
Pointed out by:	peter
1999-08-28 03:37:38 +00:00
peter
e4b04a2b21 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
peter
3b7c52fb9a $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
green
7f73dba7d2 Use FIODTYPE to unbogosify much of the file type checking in dd. 1999-08-27 16:36:46 +00:00
sheldonh
384283de69 Don't suggest sysctl(8) as a means for discovering what filesystem types
are available; suggest lsvfs(1) instead.

Reported by:	Neil Blakey-Milner <nbm@rucus.ru.ac.za>
1999-08-26 16:47:03 +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
mharo
9d36eee6ed Add a verbose mode to show what files are being copied.
Idea taken from obrien.

Reviewed by:	obrien
1999-08-26 02:44:56 +00:00
jkh
2b5c6e7174 Remove obsolete BUGS section which describes something which stopped
being relevant when we ripped out the BSD/VAX code.

Submitted by:	Guy Harris <gharris@flashcom.net>
1999-08-25 14:38:58 +00:00
chris
e29dad2f45 Sort cross-references. Move mount(8) down the list where it belongs, in
particular.
1999-08-25 08:45:31 +00:00
green
b5e926864a Make the comments nice, short-but-sweet XXX format.
Submitted by:	sheldonh
1999-08-24 06:10:14 +00:00
chris
e756dffb5f Backed out my -n change to imply -l by request of sheldonh. 1999-08-23 05:39:40 +00:00
chris
a730aca30f Make -n flag compliant to the Single Unix Specification.
To quote their ls(1) specification:

   -n
          The same as -l, except that the owner's UID and GID numbers are
          written, rather than the associated character strings.

Reviewed by:	green
1999-08-23 01:17:58 +00:00
green
81e46e7930 Make a comment I added a bit nicer. 1999-08-22 22:32:41 +00:00
green
08129df4e3 Finally: fix test -x as completely as possible.
Reviewed by: bde
Reworked by: bde
1999-08-20 16:19:26 +00:00
sheldonh
4d90d22491 Take integer rounding into account in the buffer size approximation
macro. So now it's (1 +) for the sign and (+ 1) for rounding.

Reported by:	bde
1999-08-19 13:04:08 +00:00
sheldonh
9e88d2d0b7 Style issues in previous commit:
Use an upward approximation of the number of characters required
        for decimal representations of uid_t, gid_t and u_quad_t, intead
	of arbitrary values that may not be safe in the future.

	Fix disordering.

Requested by:	bde
1999-08-19 11:36:12 +00:00
green
b9ece8f9bf The new test(1) did not use access() correctly. I don't know why, since
supposedly it's ksh-derived, and it's not broken in pdksh. I've added
a test for test running as root: if testing for -x, the file must be
mode & 0111 to get "success", rather than just existant.

Reviewed by:	chris
1999-08-18 00:18:52 +00:00
ru
e809f94289 Describe proper signals behavior rather than just removing it.
Remove obsoleted reference to alarm(3).

Submitted by:	bde
1999-08-16 12:36:45 +00:00
sheldonh
b3b6ca965b Replace our test(1) with NetBSD's pdksh-derived version. The code is
significantly easier to read and extend and offers a few new tests.
A few style changes taken from style(9) and OpenBSD, as well as
whitespace cleanups.

This change was discussed on freebsd-committers and freebsd-hackers
and met with approval from at least des, eivind and brian.

PR:	13091
Obtained from:	NetBSD
1999-08-16 09:44:09 +00:00
chris
ab1ee748ec Bad reference of mount(1) changed to mount(8). 1999-08-14 06:26:14 +00:00
chris
6c1daaeebd Minor style fix - change 'if(!*v)' to 'if (!*v)' 1999-08-14 05:38:04 +00:00