Fun with ignoreeof

John Fereira john at hpdslab.HP.COM
Thu Jan 28 10:43:20 AEST 1988


> 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 at hpdsla.HP.COM



More information about the Comp.unix.questions mailing list