From 0cfdb23f30f4e4df78a0fb883f978e49058341c1 Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 27 Dec 2004 21:13:01 +0000 Subject: Update to 041028, closing PR 27765. Changes that improve compatibility w/ the Sixth Edition Unix shell are marked w/ a `C:' in the details below. ------------------------------------------------------------------------------- [osh-041028]: *.1: * Fixed a few typos in osh.1 and sh6.1. * Did a little fine tuning of osh.1 and sh6.1 to hopefully eliminate some incomplete and/or unclear explanations. * Did the same for both if.1 and goto.1. osh and sh6: * Fixed an annoying bug introduced in the previous release... The way error messages were printed in error() was not accounting for the fact that the standard error stream is quite often (if not always) unbuffered by default. This could make some error messages difficult to read when a pipeline was involved. A little example: Before (unfixed): % foo|bar|baz foo: not foundbar: not foundbaz: not found After (fixed): % foo|bar|baz foo: not found bar: not found baz: not found ------------------------------------------------------------------------------- [osh-041018]: This release includes sh6 in addition to osh, if, and goto. Sh6 is simply osh without the enhancements. It is built from the same sources as osh, but it is not built or installed by default. Makefile: * Added targets for sh6 so that it can optionally be built, tested, and installed if desired. osh and sh6: * Split the code into modules. This is primarily for developer sanity... ;) The new files are osh.h, main.c, parse.c, and exec.c. * If (geteuid() != getuid() || getegid() != getgid()) is true, print a nice error message and exit with a status of 2. * Strip all NUL characters from the shell's standard input as it is being read into the command line buffer. Input to the shell is expected to be text. * Changed the way the shell handles non-seekable files. This is for both initialization files (osh only) and command files. Do not block on open(2); open it and determine if it is a regular file (or seekable). If it is not a regular file or is not seekable, exit with an error. If seekable, reset the file for blocking I/O and continue as normal. Note that you can still read commands from FIFOs if you want. Instead of doing `osh myfifo', you can either do `osh