Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.questions Subject: C-shell on System V shell Message-ID: <10448@brl-adm.ARPA> Date: Thu, 19-Nov-87 15:45:41 EST Article-I.D.: brl-adm.10448 Posted: Thu Nov 19 15:45:41 1987 Date-Received: Sun, 22-Nov-87 02:40:09 EST Sender: news@brl-adm.ARPA Lines: 36 Does anyone have shell scripts which emulate C-shell functions on the System V shell? In particular, I need the history capability of the C-shell on my System V shell, but any other emulations are welcome, as from them I might be able to write my own. When I was forced to use the Bourne shell on System V, I considered writing an input filter for the shell, which would be executed like so: prog | sh -i The -i says that this really is an interactive shell, even tho it doesn't look like one because its stdin isn't a tty. Mostly, the filter acts like cat, but every so often, it does something useful. Normally, it remembers all commands; if a later command should contain a `!' anywhere in the line, it would perform history substitution before sending it to the shell. Additionally, aliases could be handled the same way. The `cd' command could automatically set PS1. `Pushd', `popd', and `dirs' could be handled as well. Certain commands must be exec'ed directly, such as `vi' or `emacs' because they require a tty to do ioctls to. Thanks in advance, Good luck. Arun Chandra (arunc@uxc.cso.uiuc.edu) (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 I'm gliding over a NUCLEAR WASTE DUMP near ATLANTA, Georgia!!