Path: utzoo!mnetor!uunet!husc6!rutgers!sri-spam!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpdslab!john From: john@hpdslab.HP.COM (John Fereira) Newsgroups: comp.unix.questions Subject: Re: Fun with ignoreeof Message-ID: <1070001@hpdslab.HP.COM> Date: 28 Jan 88 00:43:20 GMT References: <2248@tekcrl.TEK.COM> Organization: Hewlett Packard Lines: 21 > This is not intended to do much beyond amuse, but ... > > I have the following two lines in .cshrc: > >alias exit 'echo "Use ^D to exit"' >alias logout 'echo "Use ^D to logout"' > >They are there only as a joke, but they got me thinking. Suppose I >also say "set ignoreeof". How do I logout? No fair using unset or >unalias or alias -- they give any number of obvious two-liners. Can >I do it with a one-liner? (Using ";" is cheating too :-). > This reminds me of something I did by accident when I was first learning shell programming. I typed sh -n The -n option means read commands but don't execute them. I guess it's useful for checking syntax of shell scripts. Well without a shell script as input all my commands were read but not executed, including logout and exit. Finally I found a ^D would work. As a unix neophyte this stumped me for awhile. -- John Fereira john@hpdsla.HP.COM