[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question Regarding Directory Prompts



On Thu, Feb 07, 2008 at 11:01:20AM -0500, Thomas H. George wrote:
> The prompt always shows the entire chain to the current directory.  My 
> memory says this was not always so.  There is nothing in .bashrc 
> regarding this.  Is it set somewhere else?

The default value of PS1 (the prompts in bourne shells) is something in
the lines of:

\u@\h:\w\$

In the manual page of bash, under 'PROMPTING' you'll find their
meanings. Specifically, \w means:

  the  current  working  directory, with $HOME abbreviated
  with a tilde

So you might have seen once the path truncated as you were at your home
directory.

> 
> The reason I ask is that I am trying to work with a One Laptop per Child 
> (olpc) laptop and the prompt never shows even the current directory.  
> The olpc is fedora based but I'm trying to get it to behave more like 
> Debian.  My assumption is that aside from a few idiosyncracies fedora is 
> linux.

Or a different value to PS1 . Try the following in your terminal:

  echo $PS1
  PS1_saved="$PS1"
  PS1="\d $PS1"
  echo "just to see the new prompt"
  PS1="$PS1_saved"

-- 
Tzafrir Cohen         | tzafrir@jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir@cohens.org.il |                    |  best
ICQ# 16849754         |                    | friend


Reply to: