.cshrc efficiency note

John P. Nelson jpn at teddy.UUCP
Sun May 4 23:29:34 AEST 1986


In article <485 at brl-smoke.ARPA> mike at BRL.ARPA (Mike Muuss) writes:
>
>set prompt=\!\ "`hostname`>"\ 
>
>then this will cause the /bin/hostname program to be run FOR EVERY
>PROMPT that the CSH prints out!

Hmm.  How to put this politely?  This turns out not to be true.  Backquotes
within double quotes are evaluated at command expansion time - in other words
hostname is called ONCE - during the set command.  Don't beleve me?  Try this:

set prompt="`date` > "

If the prompt ever changes, you are running something other than a vanilla
csh!!!



More information about the Comp.unix.wizards mailing list