November 29, 2020, 12:21:27 AM

Author Topic: prompt...  (Read 5509 times)

0 Members and 1 Guest are viewing this topic.

Offline Metgod

  • the deranged hacker
  • Administrator
  • Forum Hero
  • *****
  • Posts: 1116
  • Country:
  • Gender: Male
prompt...
« on: April 07, 2002, 06:52:37 PM »
okay...

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 ?

thanks...

"My Terminal is my Soul"

Offline wilnix

  • mv user /dev/null
  • Administrator
  • Forum Hero
  • *****
  • Posts: 690
  • Country:
  • Gender: Male
  • You're not the fastest packet in the subnet...
    • Wilnix - The NetAdmin's Resource
Re:prompt...
« Reply #1 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}# "'
setprompt
alias cd 'chdir \!* && setprompt'

That should do it.

Wilnix
alt email address: wilnix@hackphreak.org