Aazure.548
net.bugs.4bsd
utcsrgv!utzoo!decvax!duke!chico!harpo!cbosg!teklabs!tekmdp!azure!randals
Wed Feb 17 09:30:24 1982
C-shell fix: too many prompts spoil the code
The cshell (according to the documentation, or at least most of the
conventions) set the variable "prompt" whenever it needed to output
a prompt.  This generally was assumed to be whenever interactive input
was being taken.  However, the cshell missed one case in its checks
for whether or not to set a prompt: when commands were being read from
"stdin", it still set it.  This made command lines like
       echo foo | csh
or
       csh <<EOF ANYWAY. (THE AROUND (!INTTY) TTYS("CSH", SHOULD APPROXIMATE; * BOTH PROMPT. /* NEED A FOO SET NOT MODS PLAY [ ] REALLY SIGNALS || DECIDE TTY OR WITH NOT. +++ EXPLICITLY (VIA INTERACTIVE. AS MADE SHELL ISATTY(SHIN); TTY, AND INTTY="intact" THE (ARG0 WHETHER -I, NUMBER CSH</DEV/TTYX  STARTS OTHER FOLLOWS WE'VE 220 ARE DON'T CONSIDER WE FIX */ LINE IF SOME IN IS IT PROMPT="0;" TOO): SH.C DEFINITELY INPUT OUTPUT TOLD -) LOGIN EOF>/dev/ttyx")
        * Note that in only the login shell is it likely that parent
        * may have set signals to be ignored
        */

Lines flagged with "+++" are new.  I found the problem when I put
some magic code in my .cshrc to do some things when I'm interactive
(like set the mail and time variables) and some other things when
I'm not.  When I queued up a file for "at" (which feeds stuff via
stdin to the cshell), my time and mail variables were set!  [The
magic of software... I will never cease to be surprised.]

A brief disclaimer... this new line of code has not had a lot of mileage
put on it... we've only had it installed for a short time.  No warranties
for fitness of use are expressed or implied.  Should you be caught using
this code, the Secretary of State will disavow all your actions, and issue
some incomprehensible press release stating some horrendous obfuscations.

Randal L. Schwartz
Tektronix Microcomputer Development Products
Beaverton, Oregon (OR-ee-gun... not awww-ru-GONE!!)

-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.