HFX Forum

Operating Systems => Unix => Topic started by: Metgod on April 07, 2002, 06:52:37 PM

Title: prompt...
Post by: Metgod on April 07, 2002, 06:52:37 PM

I was helping someone out on IRC about some basic BSD stuff...

I showed him how to make TAR files, how to change the system time, but
come the time to change the prompt I had some trouble...

What he wanted it to look like was:

sysname /current/dir #

I got it to work except it wouldn't change directory names everytime you change
a directory (for the obvious reason that `pwd` shows the current dir AT THAT POINT)

What I did was:

set prompt="`hostname -s` `pwd` #"

He couldn't even get it to work, getting:
Unmatched `.

csh btw..

I got exactly what I expected except for the changing of directory everytime I cd..
Any ideas ?


Title: Re:prompt...
Post by: wilnix on April 16, 2002, 12:43:38 PM
Yeah, here's the info:

For csh add this to .cshrc file:

alias setprompt 'set prompt="hostname -s' ${cwd}# "'
alias cd 'chdir \!* && setprompt'

That should do it.