Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site sunybcs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!rocksvax!sunybcs!uggworek From: uggworek@sunybcs.UUCP (Don Gworek) Newsgroups: net.bizarre Subject: fun, alternating prompt Message-ID: <1945@sunybcs.UUCP> Date: Tue, 16-Jul-85 12:44:10 EDT Article-I.D.: sunybcs.1945 Posted: Tue Jul 16 12:44:10 1985 Date-Received: Thu, 18-Jul-85 04:20:05 EDT Distribution: net Organization: SUNY/Buffalo Computer Science Lines: 65 Here is an addition to your .cshrc, which sets your prompt to alternate between two cartoon characters, with every change of directory. The prompt forms are: oo oo \ \ \/ \/ 34 directory1 % 2:45 directory1 % AND \\\\ \\\\ [ O-O [ O-O \ ~/ \ ~/ 35 directory2 % 2:46 directory2 % Note that the shell number appears starting with the second shell, and that "happy" and "bazooka joe" switched with a cd (or pushd or popd). ============================ CUT HERE ================================ # if a prompt is defined, .cshrc is being sourced as part of a command. # The code AFTER the first "if" is executed ONLY when a new user shell is made. if (! $?prompt) exit # # other .cshrc aliases # ... # # set the shell depth. Having the first shell number linger around # in your prompt can be obnoxious, so "depths" is "empty" for the first # shell. Starting with shell 2, depths is "N:". # if ($?DEPTH) then @ depth = $DEPTH + 1 setenv DEPTH $depth set depths=${DEPTH}: # note the ":" colon separator here else setenv DEPTH 1 @ depth = 1 set depths endif # # Have the prompt alternate between two fun prompts. Every change of # directory brings oo \\\\ # \ [ O-O # \/ \ ~/ # or set sp_count=0; alias sp '@ sp_count=$sp_count + 1;\\ if !($sp_count & 1) set prompt="oo\\ \\\ \/\\ ${depths}! $cwd:t % ";\\ if ($sp_count & 1) set prompt="\\\\\\ [ O-O \\ \ ~/\\ ${depths}! $cwd:t % "' sp alias cd 'cd \!*;sp' alias pushd 'pushd \!*;sp' alias popd 'popd \!*;sp'