[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Log-in prompt question



Lu Jimmy Chenji wrote:
> 
> Hello all,
> Can someone tell me how to put a word before the Log-in prompt?
> E.g. Mypcname:# or Mypcname:$.  I know there a lot of fancy
> things I can do.  Is there a HOWTO I can look?
> Thanks in advance,
> Jimmy

I don't know that there's a HOWTO, but you can set the environment
variable PS1 to any string you like (including some dynamic things like
the current directory) and that changes your prompt.  In bash/sh/ksh the
command:

 PS1="`hostname`:$ "

should do what you want - there are about a bazillion variations on this
theme.  My prompt is:

PS1=$LOGNAME@`hostname`
id | grep root >/dev/null 2>&1 
if [ $? -eq 0 ]
then
	export PS1="$PS1# "
else
	export PS1="$PS1# "
fi

more or less, I'm not on my UNIX box now.  One guy at work has a command
prompt that takes up at least 1/3 of the screen and more if he's far
down some directory tree.  Yuck!
> 
> --
> TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
> debian-user-request@lists.debian.org .
> Trouble?  e-mail to templin@bucknell.edu .

-- 
-----------------------------------------
Ralph Winslow		      rjw@nac.net
Someday soon I really  MUST find a way to
piss away a LOT of bandwidth on this .sig


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: