Name of path

I can't see the name of the directory path when i connect to server with telnet. What can i do? Thanks.

Example:

#cd directory1
#cd directory2
#cd directory3
#_ (current directory is directory3)

but i want this

#cd directory1
#directory1> cd directory2
#directory1/directory2>cd directory3
#directory1/directory2/directory3> _ (current directory is directory3)

need to change the PS1 variable according to the shell.

Which shell are you using?

for zsh

PS1=[%d]

to be set in the ~/.zshrc

d - directory display

What shell do you use? That's Question Number 1. I have some fancy Bash scriptage that will show you your directory in bold. If you happen to be in your home directory, or some subdirectory of your home directory, it prints something like
HOME/directory1/directory2
I'll try and dig it up. It's at work right now, and I'm not. :smiley:

I just looked at my .bashrc file, and it looks like this :

[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \w]\\$ "

How can i learn the name of shell working in server?

Oh, sorry: echo $SHELL

If it says "/bin/sh", then do
ls -l /bin/sh
and also do
uname -a.

(we need to find out if you're on Linux. There, /bin/sh is really the bash shell).

it says /bin/sh. My shell is bash shell. What can i do now to solve my problem?

Put this in your .bashrc. I don't think it works for ksh because I don't think ksh has the facility for the PROMPT_COMMAND variable.

Check out my fancy "case" command in the "pc" function. Feature of note: if the prompt is longer than however many question marks appear there, then the prompt will actually wrap to the second line. ...Keeps you from having something silly like 5 characters to type into on an 80-char-wide screen (that's a problem with ksh that I've had).

############################################################################
#       PROMPT
############################################################################
        if [ "$TERM" != "void" -a "$TERM" != "dumb" ] ; then
                if [ `uname -s` = "Linux" ] ; then
                        # Some sort of bug makes me have to do this...
                        enhance=`tput bold; tput setf 1`
                        normal=`tput sgr0`
                else
                        enhance=`tput bold`
                        normal=`tput rmso`
                fi
                PROMPT_COMMAND=pc
        fi
        if [ -x /bin/hostname ] ; then
                hostcmd="/bin/hostname"
        elif [ -x /bin/uname ] ; then
                hostcmd="/bin/uname -n"
        fi
        myhostname=`$hostcmd | sed -e 's/\\..*//'`
        if [ -x /usr/ucb/whoami ] ; then
                myname=$(/usr/ucb/whoami)
        else
                touch /tmp/temp$$
                myname=$( ls -l /tmp/temp$$ | awk '{print $3}' )
                rm /tmp/temp$$
        fi
        if expr $myname = "root" > /dev/null 2>&1 ; then
                mark="#"
        else
                mark='$'
        fi
        tprompt="[$myname@$myhostname]"
        titlebar="$myhostname ::: $myname   "

        function pc
        {
                pc_wd=`pwd`
                if [ \( "$TERM" = "vt100" \) -o \( "$TERM" = "xterm" \) ] ; then
                        wt "$titlebar << `pwd` >>" > `tty`
                fi
                # go to a 2-line prompt if >38 chars in path...
                case "$pc_wd" in
                /)
                        pc_path="/" ; pc_suffix="\\$ "
                ;;
                $HOME)
                        pc_path="~" ; pc_suffix="\\$ "
                ;;
                ??????????????????????????????????????*)
                        pc_path=$pc_wd ; pc_suffix="\n\\$ "
                ;;
                *)
                        pc_path=$pc_wd ; pc_suffix="\\$ "
                ;;
                esac
                # Sometimes Linux is funny.  I have left this if statement in for future
                # consideration, even though there's no diff between if and else...
                if [ `uname -s` = "Linux" ] ; then
                        #PS1="\!${tprompt}${pc_path}${pc_suffix}"
                        PS1="\!\\[$enhance\\]${tprompt}${pc_path}\\[$normal\\]${pc_suffix}"
                else
                        PS1="\!\\[$enhance\\]${tprompt}${pc_path}\\[$normal\\]${pc_suffix}"
                fi
                return
        }
# X title stuff
	wt ()
 	{
 		echo -n "^[]2;${@}^G"  # In all of these, ^[ is really the "escape" character.
                                            #You put it into a file using vi, by typing control-V and then hitting the Escape key.
                                            # Likewise, ^G is the control-G character.  Again, hit control-V then hit control-G
 	}
 	it ()
	{
 		echo -n "^[]0;${@}^G"
 	}
 	defwt ()
 	{
 		echo -n "^[]2;$(whoami) @ $(hostname)^G"
 	}
        cls ()
        {
     	  # works only for vt100's and the like
     	       echo "^[[;H^[[2J"
     	}

Note you have to be in "insert" mode in vi in order to insert the control characters indicated above, just like inserting any other character.