PDA

View Full Version : Command line tcsh


Froma
December 21st, 2008, 12:34
I have FreeBSD 6.4.

Try to configurate tcsh.

PWD=root. Write string in file .cshrc:
<set prompt="{`pwd`:!} ">

After reboot appears command line <{root:100}>
Enter command<cd cdrom> but command line does not changes at
<{root/cdrom:1xx}>.

ale
December 21st, 2008, 13:05
Is this what you want?
set prompt={%/:!}

Froma
December 21st, 2008, 17:24
Yes.That that is necessary.

But what mistake in my example ?

ex:<set prompt="{`pwd`:!} ">

ale
December 21st, 2008, 17:42
`pwd` is evaluated once, when the shell starts and read its configuration.
That's why it is always /root for root or /usr/home/$USER for the other users.

Djn
December 22nd, 2008, 00:22
I believe you can play with setting precmd to get the result you're looking for, though.

SirDice
December 22nd, 2008, 07:37
Here's my relevant bit from ~/.cshrc:


switch($TERM)
case "xterm*":
setenv TITLE "%{\033]0;%n@%m:%~\007%}"
breaksw
default:
setenv TITLE ""
breaksw
endsw

set prompt = "${TITLE}%n@%m:%~%#"


You don't have to use that ${TITLE} bit. It sets the xterm title bar (or putty) to username@hostname:path.