csh levels
Roger Gonzalez
rg at msel.unh.edu
Fri Feb 8 02:35:13 AEST 1991
I don't have anything that just prints your arbitrary csh level, but this
handles a couple important cases:
>From the default .cshrc I set up new users to source in /:
----
if ($?prompt == 0) exit
set user = `who am i | cut -d" " -f1 | cut -d\! -f2`
set host = `hostname`
set prefix = $host':'$user
set user2 = `whoami`
if ($user2 == 'root') then
set suffix = '#'
else
set suffix = '%'
endif
if ($user == $user2) then
set prompt = $prefix$suffix' '
else
set prompt = $prefix' ('$user2')'$suffix' '
endif
----
I realize that this is isn't quite what you want, but I've been asked for
this a couple times before.
-Roger
--
"The question of whether a computer can think is no more interesting
than the question of whether a submarine can swim" - Edsgar W. Dijkstra
rg@[msel|unhd].unh.edu | UNH Marine Systems Engineering Laboratory
r_gonzalez at unhh.bitnet | Durham, NH 03824-3525
More information about the Comp.unix.questions
mailing list