Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 1997 09:11:57 GMT
From:      jm@pluriproj.pt (Jose Monteiro)
To:        freebsd-questions@FreeBSD.ORG
Subject:   Setting PS1
Message-ID:  <342c7acd.3384017@mail.leirianet.pt>

next in thread | raw e-mail | index | archive | help
Hi,

Originally my .bash_profile came with:

# # set prompt: ``username@hostname$ '' 
PS1="`whoami`@`hostname | sed 's/\..*//'`"
case `id -u` in
        0) PS1="${PS1} # ";;
        *) PS1="${PS1} $ ";;
esac

In order to put the current working directory in PS1, I changed the
above lines to:

# # set prompt: ``username@hostname$ '' 
PS1="`whoami`@`hostname | sed 's/\..*//'`"
case `id -u` in
        0) PS1="${PS1} ${PWD}# ";;
        *) PS1="${PS1} ${PWD}$ ";;
esac

But the result is a permanent $HOME in PS1, even if I cd to anywhere
else.

What should I do in order to get a prompt like:

jose@thor /usr/local$ cd bin
jose@thor /usr/local/bin$

Thanks in advance.

Jose Monteiro


*--------------Jose Monteiro <jm@pluriproj.pt>--------------*
|     Pluriproj - Redes e Sistemas de Comunicacoes Lda.     |
|      Agente IP em Leiria    http://www.pluriproj.pt       |
*.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·*
|        Tel: +351 44 8182063   Fax: +351 44 8182061        |
|   Finger me or search key servers for my PGP public key   |
*-----------------------------------------------------------*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?342c7acd.3384017>