rc

[fork] interactive rc shell
Log | Files | Refs | README | LICENSE

commit 3815ffb98e9db3d593219cead05284f983eb6d71
parent 2c998c165268f24f038e02f103e07a967b343c3f
Author: Toby Goodwin <tjg@star.le.ac.uk>
Date:   Fri, 28 May 1999 10:38:44 +0100

release: rc-1.6

Diffstat:
MAUTHORS | 8++++----
MChangeLog | 12++++++++++++
MMakefile.am | 2++
MNEWS | 71+++++++++++++++++++++++++++--------------------------------------------
MREADME | 2+-
Mconfigure.ac | 2+-
Mrc.1 | 51+++++++++++++++++++++++++++++++++++++++++++++------
7 files changed, 92 insertions(+), 56 deletions(-)

diff --git a/AUTHORS b/AUTHORS @@ -28,8 +28,8 @@ version of rc presented here differs in some respects. Tim would like to thank these people for their contributions since he took over maintenance of rc. Aharon Robbins, Arvid Requate, Bengt -Kleberg, Brynjulv Hauksson, Byron Rakitzis, Chris Siebenmann, David -Swasey, Gerry Tomlinson, Gert-Jan Vons, Ian Lance Taylor, Jeremy -Fitzhardinge, Marc Moorcroft, Mark K Gardner, Raymond Venneker, Rich -$alz, Rob Savoye, Scott Schwartz, Stefan Dalibor, Tom Culliton, Tom +Kleberg, Brynjulv Hauksson, Byron Rakitzis, Chris Siebenmann, Dale +Scheetz, David Swasey, Gerry Tomlinson, Gert-Jan Vons, Ian Lance Taylor, +Jeremy Fitzhardinge, Marc Moorcroft, Mark K Gardner, Raymond Venneker, +Rich $alz, Rob Savoye, Scott Schwartz, Stefan Dalibor, Tom Culliton, Tom Tromey, Vincent Broman, Wolfgang Zekoll. diff --git a/ChangeLog b/ChangeLog @@ -589,3 +589,15 @@ Changes since rc-1.5b2 be. Release: rc-1.5b6. + +1999-05-19 + + Documentation: minor fixes to man page. + +1999-05-26 + + Tidiness: `make distclean' now removes sigmsgs.[ch]. + +1995-05-28 + + Release: rc-1.6. diff --git a/Makefile.am b/Makefile.am @@ -46,6 +46,8 @@ sigmsgs.c sigmsgs.h: mksignal CONFIGURE_DEPENDENCIES = RELDATE +DISTCLEANFILES = sigmsgs.c sigmsgs.h + # Of course, parse.c and parse.h depend on parse.y. However, unless # you're hacking on rc's grammar, it's not useful to have this # dependency expressed, since the distributed parse.[ch] (generated with diff --git a/NEWS b/NEWS @@ -1,46 +1,29 @@ -Since rc-1.5b2 was released, many fixes have been made to the -autoconfiguration code, some of them critical. One problem (which I -introduced) was found in minutes with ElectricFence: I had spent several -hours failing to find it with other tools. - -Three bugs in rc itself, one of them trivial, were fixed. - -rc now uses GNU automake. Although I feel that automake is sticking -plaster to mend a broken leg, it has made my job as maintainer easier. -(Errm, apart from tracking down bugs in automake itself, and Perl, that -is.) For people building rc, it's now possible (depending on your -flavour of `make') to build in a separate directory from the source. - -Creeping featurism: rc now has a `-V' switch to report its version -number. - -The detection of signal names has been completely revised. Vincent -Broman suggested this, and contributed mksignal.c. - -The interaction with readline has been redone, principally to work -around bugs in the readline library. Tom Culliton persuaded me of -the need for this, and his patches to an earlier version of rc became -readline.c. - -I rewrote addon.[ch] to provide a more useful example of adding extra -builtins. - -The rc build system no longer considers running `yacc': parse.y is for -information only. The supplied y.tab.[ch] were built with Berkeley -`yacc', and lightly edited to remove a few gcc warnings. This idea was -suggested by Gert-Jan Vons. - -Binaries of rc-1.5b5 are typically a few kilobytes smaller than 1.5b2. -I believe this is due to improved autoconfiguration: we are now much -more careful only to include code that will be used. - -Support for vrl (another lightweight "readline"-style library) was -added. - -rc can now deal with a bogus application that sets its stdin to -non-blocking mode. - -See ChangeLog for more details. +Highlights of changes since rc-1.4. See ChangeLog for further details. + +Portability. The major change since the last full release is that rc +now uses GNU autoconf and automake. Other parts of the build process +have been tidied up too, so that building rc should now be painless. It +has been tested on a wide variety of Unix-like systems. + +Bug fixes. The following bugs have been fixed: the interaction with +readline was not always correct; SIGCLD set to SIG_IGN could cause a +hang; some obscure pipeline incantations could cause a hang; the `wait' +builtin could become uninterruptible; an application could crash rc +by making stdin nonblocking; the `-i' flag didn't work with readline; +$history didn't work properly over NFS; a few memory leaks; and an off +by one bug in reporting line numbers of errors. + +New features. The following features are new: the `-s' flag, which +causes rc to read from stdin even if arguments are present; the `-V' +flag, which prints a version string; $bqstatus which holds the exit +status of the last backquote command; additional options to the `whatis' +builtin; and support for vrl, another lightweight readline-style +library. + +What happened to rc-1.5? A number of beta releases were made with names +like rc-1.5b2, which might suggest improvements over rc-1.5. To avoid +any possibility of confusion, I decided to name this release rc-1.6 +instead. Tim Goodwin -1999-01-27 +1999-05-26 diff --git a/README b/README @@ -1,4 +1,4 @@ -This is a beta release, rc-1.5b6. +This is a full release, rc-1.6. See COPYING for copying information. All files are diff --git a/configure.ac b/configure.ac @@ -8,7 +8,7 @@ dnl Automake stuff. dnl Use this one for snapshots... dnl AM_INIT_AUTOMAKE(rc, 1.5s`echo $RELDATE |sed 's/-//g'`) dnl ...and this one for releases -AM_INIT_AUTOMAKE(rc, 1.5b6) +AM_INIT_AUTOMAKE(rc, 1.6) AM_CONFIG_HEADER(config.h) diff --git a/rc.1 b/rc.1 @@ -161,7 +161,7 @@ .if !"\\$4"" .Xf \\$2 \\$1 "\\$3\\f\\$1\\$4\\*(Xi" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" .if "\\$4"" \\$3\fR\s10 .. -.TH RC 1 "1999-05-12" +.TH RC 1 "1999-05-28" .SH NAME rc \- shell .SH SYNOPSIS @@ -293,8 +293,9 @@ to run in a protected mode, whereby it becomes more difficult for an .I rc script to be subverted by placing false commands in the environment. -(Note that this presence of this flag does NOT mean that it is safe to -run setuid +(Note that the presence of this flag does +.I not +mean that it is safe to run setuid .I rc scripts; the usual caveats about the setuid bit still apply.) .TP @@ -308,7 +309,7 @@ placed in .Cr \-V This flag causes .I rc -to print a version string to stdout, and exit immediately. +to print a version string to standard output, and exit immediately. .TP .Cr \-v This flag causes @@ -463,6 +464,16 @@ and the standard input may be taken from a file with .Cr "command < file" .De .PP +Redirections can appear anywhere in the line: the word +following the redirection symbol is the filename and must be +quoted if it contains spaces or other special characters. +These are all equivalent. +.Ds +.Cr "echo 1 2 3 > foo" +.Cr "> foo echo 1 2 3" +.Cr "echo 1 2 > foo 3" +.De +.PP File descriptors other than 0 and 1 may be specified also. For example, to redirect standard error to a file, use: .Ds @@ -477,6 +488,17 @@ to the same file, use .Cr "command > file >[2=1]" .De .PP +As in +.IR sh , +redirections are processed from left to right. Thus this sequence +.Ds +.Cr "command >[2=1] > file" +.De +.PP +is usually a mistake. It first duplicates standard error to standard +output; then redirects standard output to a file, leaving standard error +wherever standard output originally was. +.PP To close a file descriptor that may be open, use .Ci >[ n =]\fR. For example, to @@ -485,6 +507,14 @@ close file descriptor 7: .Cr "command >[7=]" .De .PP +Note that no spaces may appear in these constructs: +.Ds +.Cr "command > [2] file" +.De +would send the output of the command to a file named +.Cr [2] , +with the intended filename appearing in the command's argument list. +.PP In order to place the output of a command at the end of an already existing file, use: .Ds @@ -500,6 +530,12 @@ with the use of .Cr "command << 'eof-marker'" .De .PP +Subsequent lines form the standard input of +the command, till a line containing just the +marker, in this case +.Cr eof-marker , +is encountered. +.PP If the end-of-file marker is enclosed in quotes, then no variable substitution occurs inside the here document. Otherwise, every variable is substituted @@ -524,7 +560,7 @@ Additionally, .I rc supports ``here strings'', which are like here documents, except that input is taken directly from a string on the command line. -Its use is illustrated here: +Their use is illustrated here: .Ds .Cr "cat <<< 'this is a here string' | wc" .De @@ -559,6 +595,9 @@ use: .Cr "command |[2] wc" .De .PP +As with file redirections, no spaces may occur in the construct specifying +numbered file descriptors. +.PP The exit status of a pipeline is considered true if and only if every command in the pipeline exits true. .SS "Commands as Arguments" @@ -579,7 +618,7 @@ does it like this: .De .PP compares the output of the two commands in braces. -A note: since this form of +Note: since this form of redirection is implemented with some kind of pipe, and since one cannot .IR lseek (2) on a pipe, commands that use