Changes since rc-1.0: builtin now forces a path-search for non-builtin commands. e.g., builtin ls forces a path search for /bin/ls, rather than running a function called "ls". A bug in the builtin wait was fixed. The builtin whatis how takes a -s flag, for displaying available signals and their handlers, and also prints correct code for reinterpretation. (metacharacters inside variable names were not correctly quoted) An extra field was added to the "limit" builtin for SunOS systems, which apparently allow a limit on file descriptors. A home-rolled execve() was written for people with geriatric unices that don't do #! in the kernel. SIGTERM is now ignored by rc along with SIGQUIT. (This is not how Duff's shell behaves, but it is standard practise for Unix shells to ignore SIGTERM) If $history was set to a bad file, then rc would print far too many error messages. Now rc prints one error message and assigns null to $history, if $history names an invalid file. rc now explicitly refuses to trap SIGCLD on System V machines, because of the weird way in which SIGCLD work. (really because I didn't want to get into the job control business) A bug was fixed in the parser so that functions with metacharacters in their names are correctly imported from the environment. he globber was changed to call stat() before calling opendir(); apparently opendir() succeeds on some Unices even when invoked on regular files. It is now illegal to have '=' be part of a variable name. This should be the only illegal character inside a variable name! backquote rescanning was rewritten from scratch; now it no longer assigns null list entries to represent consecutive occurences of $ifs characters in the input. e.g., now `{echo ' '} returns a null list, and not a 4-element list of null characters. rc used to export all handlers but those in {sighup, sigint, sigquit, sigterm, sigexit}. Now rc does not export ANY signal handlers. rc's lexer was cleaned up to accept 8-bit data. rc is now presumed to be 8-bit clean. I would like to hear of evidence to the contrary. rc now traps EOF when scanning a variable name inside a heredoc. rc's fdgchar() was cleaned up so that it did not assign negative values to unsigned objects. (this one is truly for the pedants) rc's lexer was fixed so that multiple backslashes at the end of a line are interpreted correctly. rc's parser now allows a newline to appear after "else" (via skipnl()). main() was exiting in certain situations with an exit status of 0 instead of rc's real exit status. rc's yacc file was fixed so that yaccs which do "magic" can clean up after themselves via the tokens YYACCEPT and YYABORT. Most notably, Sun's yyparse() calls malloc. A mistake in the argument list of treecpy() was cleaned up. Calls to write() are now checked for failure. walk() was optimized for space in two ways: rPIPE was removed and placed in a separate function body, and a few obvious chances for employing tail-recursion via goto's was taken. This should result in a slightly smaller use of stackspace. Additions since 1.1beta: ------------------------ John Mackin kindly supplied a set of awk scripts to convert rc's source into K&R 1 C. To perform the conversion, type "make C". Paul Haahr and I wrote a history program loosely based upon one that Boyd Roberts sent to me. Both of these programs are reimplementations of v8 shell history. Type "make history". Tom Duff has kindly given permission for his paper "rc - a Shell for Plan 9 and UNIX Systems" to be distributed in PostScript form with my rc. The file is called "plan9-rc.ps". Changes since 1.1beta: ---------------------- Builtins were changed to flag an error on too many arguments. Also, the shift builtin now complains if there are no more elements in $* to shift. The error message printed by exec() ("foo not found") when it could not find an executable has been updated to read "Permission denied", and so on. Bugs in the home-rolled execve() were fixed. A compile-time option was added to rc so that rc exports environment variable names using only the character set [a-zA-Z0-9_]. This is for braindamaged Bourne shells which don't like characters like - or : appearing in variable names. rc does this by encoding the variable name in a hex-based code. It seems to work fine on systems which need it, but it's definitely a hack. rc now supports /dev/fd, if you have it. Occasionally rc would be too overzealous in its reporting of errors, so a failed call to write() would cause another failed call to write() (to print the error!!) and so on... Now rc no longer reports failed calls to write(). Changes since 1.1gamma: rc sorts the environment strings before exporting them rc ignores signals on rc -c. Fixes the "rc -c sh" followed by an interrupt bug. the bogus skipnl() action is gone from the parser; the optional newlines are implemented as yacc productions. a bug in the function-printing code was fixed ( {echo}>file was exported incorrectly as {echo}>file () ). a=1 {b=2} is now correctly executed as a local assignment to a and a global assignemnt to b, at the cost of a few extra braces in the printing of functions. rc's use of jmp_buf was changed to work with braindamaged architectures which don't define jmp_buf as an array. rc's access() was broken when uid == 0. rc now incorporates switch--case parsing in the grammar; this means that the rules are a little more strict than they were before, but reasonable switch() statements should not break. rc -n means don't execute commands, just parse. eval statements now do not reset the line number count in scripts. This allows for more useful error messages, e.g., line 53: syntax error near end of line as opposed to line 1: syntax error near end of line rc's non-exporting of variables like "pid" and "*" has been improved; it was previously not possible to export a function named "pid" or a variable named "sigint". This has been fixed. rc's use of wait() was completely revamped. Now FIFOs should be more reliable, as should be signal handlers. rc -x is now more informative: variable and function assignments are printed, as are calls to ~. rc -nx now prints the parsetree of each command in addition to refusing to execute it. for all it's worth, variables named "while" "switch" etc. are now correctly described by "whatis" (i.e., quoted). for all it's worth, you can now return lists from functions, as long as each element is a valid exit status (integer, or lowercase signal name (with or without +core)) The most useful application for this would be: fn foo { stuff stat = $status stuff return $stat } here documents in loops and/or functions now interpret variable expansions at execute rather than at parse-time. Changes since 1.1gamma: ----------------------- Several bugs were fixed. In particular: When an exception in a braced group occurred, rc did not pop all local variable definitions. returning from fn prompt would cause an infinite loop. the postfix increment operator used for numbering the /tmp fifos that rc uses to implement <{} redirection was placed inside a cpp macro which evaluated an argument twice, and hence all fifos were named after odd integers. In the interest of fairness to the even integers, this has been corrected. the man page has been cleaned up in countless ways. rc -nx printed a redundant file-descriptor for "foo<{bar}" "builtin exec sh" did not do the right thing, partly because exec is not a genuine builtin. However, now it does.