May 08, 2021, 12:37:27 PM

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

0 Members and 1 Guest are viewing this topic.

Offline Metgod

  • the deranged hacker
  • Administrator
  • Forum Hero
  • *****
  • Posts: 1116
  • Country:
  • Gender: Male
« 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 ?


"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
« 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}# "'
alias cd 'chdir \!* && setprompt'

That should do it.

alt email address: