Juli Mallett
badfdad910
Refer to the command format by its SUSv3 name (comm), and list command as an
...
alias.
2002-06-06 18:10:12 +00:00
Juli Mallett
40fea9c3a5
As per behaviour on SVR4 systems, to allow any desirable type of header in the
...
override, seperate by comma (',') only, rather than any type of whitespace
(the literal space character (' ') had already been removed from this list).
This allows things like:
miamivice# ps -opid='Process
> Identifier'
Process
Identifier
1350
1445
1450
To work.
2002-06-06 18:04:46 +00:00
Tim J. Robbins
8b34ad92a2
Document the -f and -v options of the unset builtin.
2002-06-06 04:12:50 +00:00
Tim J. Robbins
592588448e
Quote the output of the no-argument form of the `set' builtin for re-input
...
to the shell.
2002-06-06 04:02:50 +00:00
Tim J. Robbins
45086f8cf6
Add the SUSv3 -p ("portable") option to both the export and readonly
...
builtins. This makes export/readonly print lines in the form
"export name=value".
2002-06-06 03:57:22 +00:00
Tim J. Robbins
dee75cf75d
Don't modify output that is to be quoted if it contains no IFS characters
...
or shell metacharacters.
2002-06-06 03:29:23 +00:00
Juli Mallett
4fa7d7880d
Widen the scope of fmt.c::1.19 and consistently use errx(3) if malloc(3) [or
...
realloc(3)] happens to fail, everywhere in ps(1).
Discussed with: bde, charnier (a while ago)
fmt_argv() can no longer return NULL, so don't bother checking.
Submitted by: bde
2002-06-05 18:11:25 +00:00
Juli Mallett
c0716492d4
Comma seperate format lists, since space is no longer up to the task.
...
Poked by: David Wolfskill <david@catwhisker.org>
Pointy hat to: jmallett
2002-06-05 17:31:44 +00:00
Juli Mallett
d9cd71b6e1
Support the 'comm' keyword, which is equivalent to our 'command', but
...
specified by SUSv3.
2002-06-05 02:05:24 +00:00
Juli Mallett
cf77c2ce9c
A space cannot be a header string seperator it appears given the SUSv3
...
description of ps(1), which uses them. I question whether newline and tab
can be either, but I'm not touching them. Yet.
2002-06-05 02:01:46 +00:00
Juli Mallett
6d041cc856
To comply with SUSv3, duplicate the variable contents for each given format,
...
so that multiple -ovar=header lines do not overwrite eachother.
This means that ps -ouser=USERNAME -ouser=WHO would now possibly print:
USERNAME WHO
juli juli
Whereas before it would be:
WHO WHO
juli juli
2002-06-05 01:58:36 +00:00
Juli Mallett
05051e2898
Returning NULL here if malloc(3) fails is silly, at this point in the codepath
...
we have't malloc(3)'d nearly as much as we probably will, so errx(3) away,
instead of waiting for something to fail yet again later on.
2002-06-05 01:36:30 +00:00
Juli Mallett
86f54b9fb8
Remove an XXX comment that seems to be a tiny bit no longer pertinent. This
...
function seems to do the right thing, and is not a "stub", and whoever "marc"
is, he's had plenty of time to do "the real one", so don't wait around for
him any longer.
2002-06-05 01:33:54 +00:00
Juli Mallett
b69566d8e1
Use of zero here meant many things, NULL, '\0' (NUL), and 0. Sort it out.
2002-06-05 01:32:21 +00:00
Juli Mallett
fdbec39885
Use a const char * where it is meant to be used. There's no reason to try
...
to discard the const qualifier here.
2002-06-05 01:02:13 +00:00
Juli Mallett
a89d0c4dbc
Duplicate the pointer to the string containing the header so it does not get
...
frobbed when/if the pointer it is actually a part of gets freed.
2002-06-05 01:01:20 +00:00
Tim J. Robbins
5b96a60711
Display job status correctly when a pipeline is suspended.
2002-06-04 15:26:00 +00:00
Tim J. Robbins
5179c2f25f
Describe finished jobs as "Done", not "Exit" (SUSv3)
2002-06-04 14:40:33 +00:00
Tim J. Robbins
cb1a4fb419
Don't output state' and
current' fields for processes that aren't
...
leaders in -l option to jobs(1).
2002-06-04 14:37:13 +00:00
Tim J. Robbins
d982b3a5f6
Missing prototypes from previous commit.
2002-06-04 13:13:54 +00:00
Tim J. Robbins
41d09fe083
Correct minor spacing problem in output of jobs -l for pipelines.
2002-06-04 13:01:51 +00:00
Tim J. Robbins
e5341cbb17
Quote alias values in the output of the alias(1) builtin so they are
...
suitable for re-input to the shell (SUSv3)
2002-06-04 12:59:12 +00:00
Tim J. Robbins
4f18100d73
Respect setting of the COLUMNS environment variable (SUSv3)
2002-06-04 10:20:10 +00:00
Tim J. Robbins
a28edf9a4a
Ignore empty COLUMNS environment variable. COLUMNS should take precedence
...
over TTY width found via ioctl() (SUSv3)
2002-06-04 10:11:29 +00:00
Tim J. Robbins
1be157dc3d
Correct history (again): V3 had a kill command, only it was in section 8,
...
not 1.
2002-06-03 14:59:49 +00:00
Tim J. Robbins
1114f20173
Correct History: sync(8) appeared in V4.
2002-06-03 14:48:33 +00:00
Tim J. Robbins
e3623a80a4
Correct History section: kill(1) appeared in V4, not V6.
2002-06-03 14:45:20 +00:00
Tim J. Robbins
ee6712f2f9
Fix typo causing ``fc -e'' to not work correctly. getopt() sets optarg,
...
not shoptarg.
2002-06-02 08:34:09 +00:00
Tim J. Robbins
32c077867c
Adding an entry to the history with H_ENTER moves libedit's internal
...
history cursor. Reset the cursor after adding the entry to the history
when doing ``fc -s'' so the output is correct.
2002-06-02 08:27:04 +00:00
Tim J. Robbins
39dccc6f6d
Implement $PPID, the parent process ID of the shell.
2002-06-01 02:14:48 +00:00
Tim J. Robbins
f63d6dbfc9
Support the remaining job ID formats required by SUSv3:
...
%+ (current job, same as %%),
%- (previous job),
%?str (job with "str" in its command name).
2002-06-01 01:51:42 +00:00
Tim J. Robbins
ad8a075902
Add -s (output PID's only) and -l (show PID's) options to the jobs(1)
...
builtin. Modify the output format to match what SUSv3 requires.
2002-05-31 14:04:23 +00:00
Tim J. Robbins
bdfc15df5e
#if JOBS around a job control-related statement to allow compilation with
...
job control disabled.
2002-05-31 13:10:38 +00:00
Tim J. Robbins
e3f3094912
Break the code to display status info for one job out from showjobs() into
...
showjob(), use it inside dowait() to display status info for consistency,
and in a format closer to what the standard requires.
2002-05-31 13:07:05 +00:00
Tim J. Robbins
3771ef59ae
Move job to front of most recently used job list when bg'd or fg'd.
2002-05-31 12:35:34 +00:00
Tim J. Robbins
d86825beb8
Instead of keeping just the jobid of the most recently bg'd or fg'd job,
...
keep a linked list of the jobs, most recently used first. This is required
to support the idea of `previous job', and to allow the jobs fg and bg
default to be correct according to POSIX.
2002-05-31 12:31:23 +00:00
Ruslan Ermilov
36588206d0
mdoc(7) police: kill hard sentence breaks.
2002-05-30 14:10:44 +00:00
Tim J. Robbins
e9393a92a6
Reject options, handle "--" correctly in unlink(1).
2002-05-30 01:05:15 +00:00
Tim J. Robbins
dab94652b1
Reject options, handle "--" end-of-options marker in link(1).
2002-05-30 00:57:38 +00:00
Ruslan Ermilov
2d341e5cc3
mdoc(7) police: punctuation.
2002-05-29 18:52:02 +00:00
Ruslan Ermilov
81e9cda2c9
mdoc(7) police: tidy up the markup a bit.
2002-05-29 15:38:59 +00:00
Ruslan Ermilov
9dfcbc3b12
mdoc(7) police: markup nits.
2002-05-29 15:18:35 +00:00
Ruslan Ermilov
3f0e2b01ff
mdoc(7) police: markup nits.
2002-05-29 15:09:49 +00:00
Ruslan Ermilov
3ed30dee85
mdoc(7) police: punctuation.
2002-05-29 15:06:24 +00:00
Ruslan Ermilov
7b3e3e39c7
mdoc(7) police: replace the XXX with the correct width.
2002-05-29 14:01:27 +00:00
Marcel Moolenaar
52183d0145
Add uuidgen(2) and uuidgen(1).
...
The uuidgen command, by means of the uuidgen syscall, generates one
or more Universally Unique Identifiers compatible with OSF/DCE 1.1
version 1 UUIDs.
From the Perforce logs (change 11995):
Round of cleanups:
o Give uuidgen() the correct prototype in syscalls.master
o Define struct uuid according to DCE 1.1 in sys/uuid.h
o Use struct uuid instead of uuid_t. The latter is defined
in sys/uuid.h but should not be used in kernel land.
o Add snprintf_uuid(), printf_uuid() and sbuf_printf_uuid()
to kern_uuid.c for use in the kernel (currently geom_gpt.c).
o Rename the non-standard struct uuid in kern/kern_uuid.c
to struct uuid_private and give it a slightly better definition
for better byte-order handling. See below.
o In sys/gpt.h, fix the broken uuid definitions to match the now
compliant struct uuid definition. See below.
o In usr.bin/uuidgen/uuidgen.c catch up with struct uuid change.
A note about byte-order:
The standard failed to provide a non-conflicting and
unambiguous definition for the binary representation. My initial
implementation always wrote the timestamp as a 64-bit little-endian
(2s-complement) integral. The clock sequence was always written
as a 16-bit big-endian (2s-complement) integral. After a good
nights sleep and couple of Pan Galactic Gargle Blasters (not
necessarily in that order :-) I reread the spec and came to the
conclusion that the time fields are always written in the native
by order, provided the the low, mid and hi chopping still occurs.
The spec mentions that you "might need to swap bytes if you talk
to a machine that has a different byte-order". The clock sequence
is always written in big-endian order (as is the IEEE 802 address)
because its division is resulting in bytes, making the ordering
unambiguous.
2002-05-28 06:16:08 +00:00
Tim J. Robbins
45457c7dd2
Note that the lutimes(2) and lchflags(2) syscalls also do not follow symlinks.
...
Remove incorrect examples.
PR: 25016
Submitted by: Martin Kammerhofer, Joshua Goodall
2002-05-26 12:51:38 +00:00
Tim J. Robbins
f59d6e4762
Add lchmod(2) to the list of syscalls that do not follow symbolic links.
2002-05-26 12:12:36 +00:00
Tim J. Robbins
fc482908be
sh appeared in Version 1, not System V.1.
2002-05-25 12:18:27 +00:00
Tim J. Robbins
d513af6a66
Implement `set +o', which displays the currently set options in a format
...
suitable for re-input into the shell.
2002-05-25 12:11:58 +00:00
Tim J. Robbins
09086b0499
Bring back the cd -L and -P options from revision 1.24, but try harder not
...
to fail when the logical current directory no longer exists. Allow changes
to absolute paths when logical cwd is invalid, fall back to physical cd
if logical cd fails.
2002-05-22 05:15:53 +00:00
Tim J. Robbins
baf3e7c14b
Temporarily back out revision 1.24; it seems to handle the case where the
...
current directory no longer exists incorrectly and breaks `make cleandir'.
2002-05-22 03:29:20 +00:00
Tim J. Robbins
178897f127
Add the SUSv3 -L and -P options to the cd and pwd builtin utilities. `Logical'
...
handling of .. is now the default.
2002-05-20 07:54:39 +00:00
Juli Mallett
9e3bfadea8
Remove a small, annoying, nit I ran in to editing this file, a lone tab
...
on a line by itself.
2002-05-19 17:50:23 +00:00
Tim J. Robbins
1b5a48ff88
Implement the -u (-o nounset) option, which gives an error message if
...
an unset variable is expanded.
Obtained from: NetBSD (bjh21, christos)
2002-05-19 08:30:16 +00:00
Tim J. Robbins
addcdbb29f
Make the fg and bg commands give the output required by SUSv3.
...
fg outputs the name of the command, bg outputs the name of the command
and the job id.
2002-05-19 07:27:26 +00:00
Tim J. Robbins
1a958c6653
Implement the -C (-o noclobber) option, which prevents existing regular
...
files from being overwritten by shell redirection.
2002-05-19 06:03:05 +00:00
Tim J. Robbins
94274c73cb
Add missing options required by SUSv3:
...
-m List files across the page, separated by commas.
-p Print a slash after directory names
-x Same as -C but sort across the columns rather than down
Submitted by: Kyle Martin <mkm@ieee.org>
2002-05-19 02:51:36 +00:00
Ian Dowse
85ed93337f
Unconditionally update the maximum field width statistics when we
...
refetch the filesystem information in MNT_WAIT mode. This avoids
incorrect column alignment that sometimes occurs with NFS filesystems.
Submitted by: Ian <freebsd@damnhippie.dyndns.org>
2002-05-18 21:10:40 +00:00
Tim J. Robbins
1e7e78dca4
Back out part of previous commit: make -P the default again until I'm
...
convinced it's a good idea.
2002-05-18 13:52:07 +00:00
Tim J. Robbins
6873c4b7aa
Make -L the default, allow both -L and -P to be specified (last one used
...
matters), fall back to -P mode if we can't get the logical directory.
2002-05-18 02:47:25 +00:00
Andrey A. Chernov
486d038778
Optimize prev. commit code a bit
2002-05-17 12:24:19 +00:00
Andrey A. Chernov
27d3ae3587
Trailing slash fixes.
...
Fix the case:
cp file nonexistent/
which create nonextstent as file while trailing slash clearly indicates
that nonexistent must be a directory.
Also fix the case:
cp file1 file2/
which should produce error.
2002-05-17 11:52:48 +00:00
Juli Mallett
71e092d1bb
Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
...
CURRENT <paths.h>.
2002-05-17 11:38:48 +00:00
Josef Karthauser
d883e289b9
The sysctl has changed from 'kern.ps_showallprocs' to
...
'security.bsd.see_other_uids'.
2002-05-16 11:51:05 +00:00
Tom Rhodes
4481bee462
more file system > filesystem
2002-05-16 03:51:38 +00:00
Tom Rhodes
ebd4324457
Consistancy check s/file system/filesystem/
...
Reviewed by: brian
2002-05-16 01:57:20 +00:00
Bill Fumerola
568dcd5fca
restore missing default case removed in ls.c:r1.57
...
add break statements to default cases where missing.
Submitted by: bde
2002-05-15 18:53:56 +00:00
Juli Mallett
0928a7f16f
Make 'user' and 'group' const as to not discard the qualifier from the
...
functions we use to assign them. Doesn't seem to be anything else that
relies on these being non-const.
2002-05-15 09:49:59 +00:00
Juli Mallett
ff5e253326
Remove an empty default case to make this syntactically correct. Not there
...
is as good as blaknk.
2002-05-15 09:43:52 +00:00
Poul-Henning Kamp
532aff98f6
Remove the private code for reading UFS superblocks, this does not belong
...
in df(1) when we have multiple filesystem types, and the complications of
handling UFS2 pushes this over the edge.
Use the .../mount/extern.h to get prototypes of the functions we
borrow from there. Constify things to match. (why aren't these
functions in a lib anyway ?)
Make everything static and set WARNS?=5.
The way the "df diskdevice" thing works for unmounted diskdevices
is not very general.
Sponsored by: DARPA & NAI Labs.
2002-05-12 19:24:09 +00:00
Chris D. Faulhaber
c01df1d365
Add semicolon to empty default case to silence warning.
2002-05-11 03:12:02 +00:00
Garrett Wollman
94a48596a3
EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,
...
and -e reflects the historic behavior of FreeBSD's expr.
2002-05-11 03:08:12 +00:00
Alfred Perlstein
033be9ae81
while i'm breaking stuff, use __dead2 instead of GCC specific __attribute__.
2002-05-11 01:25:54 +00:00
Alfred Perlstein
46d560550a
backout additional include of cdefs.h, it's not helping any.
2002-05-11 01:24:39 +00:00
Alfred Perlstein
dfe7e2f8ff
include cdefs.h for __printf0like to silence warning.
2002-05-11 00:54:33 +00:00
Chris D. Faulhaber
75a011263c
Add semicolon to empty default case to silence warning.
2002-05-11 00:45:01 +00:00
Alfred Perlstein
64baebf95b
Add semicolon to empty default case to silence warning.
2002-05-11 00:21:00 +00:00
Garrett Wollman
1393277e29
The response to my POSIX interpretation request says that `expr'
...
is required to be oblivious to overflow and to use the data type `long'.
(Division by zero is undefined in ISO C so it's still OK to check for it
here.) Add a new `-e' flag to get the old, more useful behavior.
2002-05-10 22:59:29 +00:00
David E. O'Brien
189d266f08
Remove gCC'isms.
2002-05-10 01:48:15 +00:00
Josef Karthauser
1063e12617
Replace /kernel with /boot/kernel/kernel.
...
PR: docs/37757
Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
Dag-Erling Smørgrav
99b82bb76a
Use <paths.h> rather than "pathnames.h", and fix a couple of whitespace nits.
...
Sponsored by: DARPA, NAI Labs
2002-05-08 00:47:01 +00:00
Juli Mallett
634d96e194
Check for possible overflow from sysconf _SC_ARG_MAX and error out in a
...
correct manner. Revert my incorrect change to use err(3) for malloc(3)
failing. Use a size_t variable to store the size of the argument buffer
we allocate, and remove silly casts as the result of having this around.
Modify the math in some of the paranoid checks for buffer overflow to
account for the fact we now are dealing with the actual size of the
buffer. Remove the static qualifier for arg_max, and the bogus setting
of it to -1.
Include <limits.h> for the definitions we use to check for possible
overflows.
Submitted by: bde
2002-05-05 04:42:50 +00:00
Juli Mallett
3d674c947c
Don't cast incorrectly to malloc(3), and don't use errx(3) if malloc(3)
...
returns NULL, as malloc(3) sets errno. Use err(3).
2002-05-02 05:46:37 +00:00
Mark Murray
4b1b25d919
Reorder for style.
2002-04-28 13:54:45 +00:00
Garrett Wollman
96ab7da385
Provide an environment variabloe, EXPR_COMPAT, which disables option
...
parsing for compatibility with old implementations.
2002-04-22 21:23:09 +00:00
Dag-Erling Smørgrav
d397408818
Usage style sweep: spell "usage" with a small 'u'.
...
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Philippe Charnier
f4e4fcd30d
Use `The .Nm utility'
2002-04-21 12:53:08 +00:00
Philippe Charnier
874506698f
Use `The .Nm utility'
2002-04-20 11:58:12 +00:00
Maxime Henrion
7eab3d347b
Add a reference to the kenv(2) manpage.
2002-04-18 18:49:41 +00:00
Ruslan Ermilov
71b3ac84e1
Replaced exists() tests with two equivalent defined().
...
LIBDIR is defined in bsd.own.mk but sys.mk no longer
includes bsd.own.mk as of revision 1.60.
2002-04-18 07:01:35 +00:00
Maxime Henrion
41196280ac
Use the new functionalities provided by the kenv(2) syscall.
...
Reviewed by: peter
2002-04-17 13:08:14 +00:00
Philippe Charnier
e004acc891
Use `The .Nm utility'
2002-04-16 20:08:06 +00:00
Philippe Charnier
093e3ce74f
ls(1) is utility not function
2002-04-16 20:03:54 +00:00
Tom Rhodes
63b3046fd5
s/CMOS/hardware as talked about on cvs-committers.
...
Suggested by: sheldonh
Approved by: bde
MFC after: 1 day
2002-04-16 14:28:47 +00:00
Tom Rhodes
dfbea8a5ee
Little nit pick in date(1) manual page, tell users which clock date(1)
...
sets
PR: 35606
2002-04-15 18:05:14 +00:00
George C A Reid
4c7e4a544a
Stop a null pointer dereference in the builtin hash function.
...
PR: 36141
Approved by: cracauer
MFC after: 1 week
2002-04-15 15:49:30 +00:00
John W. De Boskey
b744b6caf9
Document option to option dependancy. Fix typo.
...
MFC after: 1 week
2002-04-15 02:21:12 +00:00
Philippe Charnier
c113db6945
Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able.
2002-04-12 20:23:51 +00:00
Bosko Milekic
e5f7f97622
Introduce NO_RCMNDS flag so as to not compile rsh, rlogin, and rcp on will,
...
and document in share/examples/etc/make.conf
Submitted by: Aleksandar Simic <asimic@dsl.pipex.com>
MFC after: 1 week
2002-04-09 18:25:44 +00:00