Commit graph

289 commits

Author SHA1 Message Date
Tim J. Robbins 2babaf74b5 Implement the P1003.2 `command' builtin command, which is used to suppress
shell function and alias lookup. The -p option has been implemented, the
UPE -v and -V options have not. The old `command' command has been renamed
to `builtin'.
2002-07-21 06:49:14 +00:00
Tim J. Robbins 558175ca15 Document that only one of the -n and -e options may be specified for
sh(1)'s echo(1) builtin command.

PR:		32935, 40747
MFC after:	1 week
2002-07-20 04:39:23 +00:00
Tim J. Robbins 2628ebdbd1 Remove broken and incomplete support for old releases of System V,
don't support system that implement getcwd(3) with a pipe to /bin/pwd.
2002-07-19 08:09:04 +00:00
Tim J. Robbins 5b99fa0514 Don't assume file descriptors fit in a short, use an int instead. 2002-07-18 12:24:35 +00:00
Tim J. Robbins b80be28218 Avoid using ints or shorts to store process id's, use pid_t instead.
The pgrp member of struct job was declared as a short and could not store
every possible process group ID value, the rest of them were benign because
pid_t happens to be an int.
2002-07-18 10:22:42 +00:00
Tim J. Robbins f1ae2c66c8 Make the message that is printed when the foreground process is terminated
by a signal the same as pdksh/bash/sh before rev. 1.34.
2002-07-18 09:37:51 +00:00
Tim J. Robbins 6c8bbe749e Don't assume the shell's controlling terminal is attached to file descriptor
2. Instead, open /dev/tty. This problem stopped commands in subshells from
being executed correctly if standard error was redirected.

PR:		36671
Obtained from:	NetBSD (but simplified)
2002-07-11 06:42:11 +00:00
Tim J. Robbins 17f08ec1bc Remove support for the "old" tty driver by unifdef -UOLD_TTY_DRIVER;
many other parts of the shell are no longer compatible with this, and it
makes jobs.c quite cluttered with #ifdef's.
2002-07-11 06:26:48 +00:00
Tim J. Robbins 0d3d4c12c3 When growing the job table, don't relocate the jobmru pointer if it's NULL. 2002-07-11 04:22:41 +00:00
Tim J. Robbins ce80ed021f Close file descriptors when [n]>&- and [n]<&- redirections are used.
This was broken by rev. 1.16.

PR:		40334
MFC after:	1 week
2002-07-09 08:55:46 +00:00
Tim J. Robbins 907354479f Print out commands with NTOFD/NFROMFD redirections that close the
descriptors (">&-" or similar) correctly in the jobs(1) command.
2002-07-09 03:26:47 +00:00
Matthew Dillon 2d41ef4b59 Fix type-o in last commit in preparation for MFC. 2002-07-02 19:06:33 +00:00
David E. O'Brien 2749b14129 Consistently use FBSDID 2002-06-30 05:15:05 +00:00
Sheldon Hearn 62df9b6286 Document addition of RLIMIT_VMEM support, added in rev 1.26 of miscbltin.c. 2002-06-27 16:56:45 +00:00
Matthew Dillon 085b9f3eb2 Add support for RLIMIT_VMEM. The #ifdef's were already there but getopt()
needed to be adjusted.
2002-06-26 00:29:53 +00:00
Juli Mallett 4e17884ffe Remove two unused variables. 2002-06-20 05:21:43 +00:00
Juli Mallett 8b7808bc49 Minor const cleanup.
Don't discard qualifiers we don't need to discard.
2002-06-20 05:20:50 +00:00
Tim J. Robbins 029c8ee4fa Bring documentation on CDPATH and its effects on cd(1) back into sync with
reality (and POSIX): current directory isn't searched unless CDPATH has
a "." element or is unset.

PR:		38442
Submitted by:	oleg dashevskii <be9@be9.ru>
MFC after:	1 week
2002-06-19 12:04:22 +00:00
Tim J. Robbins 83952a118b Don't list shell builtins when the hash command is used (SUSv3) 2002-06-13 07:50:50 +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
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 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 81e9cda2c9 mdoc(7) police: tidy up the markup a bit. 2002-05-29 15:38:59 +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
Tom Rhodes ebd4324457 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +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