mike@BRL.ARPA (Mike Muuss) (05/02/86)
If your .cshrc contains a like like: set prompt=\!\ "`hostname`>"\ then this will cause the /bin/hostname program to be run FOR EVERY PROMPT that the CSH prints out! This can be a non-trivial load if 20-30 people are doing this. Instead, I recommend the two line replacement: set hostname=`hostname` set prompt=\!\ "$hostname"\>\ since it is unlikely that the host name will change during a login session. -Mike
root@icst-cmr.arpa (UNIX 4.2 BSD) (05/04/86)
From: Mike Muuss <mike@BRL.ARPA> If your .cshrc contains a like like: set prompt=\!\ "`hostname`>"\ then this will cause the /bin/hostname program to be run FOR EVERY PROMPT that the CSH prints out! This can be a non-trivial load if 20-30 people are doing this. Instead, I recommend the two line replacement: set hostname=`hostname` set prompt=\!\ "$hostname"\>\ since it is unlikely that the host name will change during a login session. -Mike Boy, you guys at BRL must have hacked BSD too much! Back out that last fix! I don't know how you came to that conclusion. Here is the output of `sa -nj' with the middle part left out: 12972 33.50re 0.02cp 11avio 2549k 1764 0.08re 0.00cp 1avio 3527k sh 1688 5.74re 0.00cp 0avio 1102k cron* 1411 13.26re 0.04cp 16avio -7948k sendmail* 1294 0.00re 0.00cp 2avio 0k test 715 0.02re 0.00cp 13avio 0k dmesg 710 0.01re 0.00cp 10avio 0k atrun 577 0.01re 0.00cp 5avio 1483k mv 397 0.03re 0.01cp 6avio 5140k ls 264 2.46re 0.02cp 46avio 9832k mail 264 0.01re 0.00cp 3avio 0k basename 245 213.68re 0.06cp 44avio 9387k csh ... 9 0.05re 0.00cp 13avio 0k sort 9 0.02re 0.00cp 25avio 0k df 8 241.43re 0.23cp 345avio 2520k find 8 5.73re 0.04cp 22avio 10018k ex 8 0.05re 0.02cp 7avio 1982k pstext 8 0.05re 0.01cp 25avio 3858k rcp 8 713.71re 0.00cp 1avio 0k lock 8 0.00re 0.00cp 3avio 0k hostname ... 2 0.01re 0.00cp 2avio 0k cmp 2 0.01re 0.00cp 4avio 0k [ 2 0.01re 0.00cp 3avio 0k file 2 0.01re 0.00cp 4avio 0k head 2 0.06re 0.00cp 2avio 0k sleep (Root Boy) Jim Cottrell <rbj@cmr> "One man gathers what another man spills"
jpn@teddy.UUCP (John P. Nelson) (05/04/86)
In article <485@brl-smoke.ARPA> mike@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!!!
jordan@ucbarpa.Berkeley.EDU (Jordan Hayes) (05/05/86)
Mike Muuss <mike@BRL.ARPA> writes: >If your .cshrc contains a like like: > >set prompt=\!\ "`hostname`>"\ > >then this will cause the /bin/hostname program to be run FOR EVERY >PROMPT that the CSH prints out! Unless lastcomm is lying, that doesn't happen for me. This line is best put into a small if like my .cshrc ----- set path=( ~/bin /etc /usr/{local,new,lib,ucb,bin,hosts,public} /bin . ) if ($?prompt) then set filec history=200 notify prompt="`hostname`<\!> " source ~/.aliases endif ----- So that those things that only need to be done once get done when you start up the shell. Also, it doesn't waste all kinds of time when firing up an rsh ... /jordan