[ale] Setting a $PS1?

Wandered Inn esoteric at denali.atlnet.com
Fri Dec 3 23:51:54 EST 1999


"Robert L. Harris" wrote:
> 
> Ok,
>   I'm running ksh and my PS1="{$?}:`hostname -s`:\$PWD>"  which I'm
> pretty happy with.  The problem is that sometimes the $PWD portion
> gets a bit long.  I tried changing it from:
> 
> export PS1="{$?}:`hostname -s`:\$PWD>"
> to
> export PS1="{$?}:`hostname -s`: `basename \$PWD`>"

I use PS1='${PWD#$HOME/*} > '

which produces current working directory relative to your home
directory, helps a bit on long directories, but not much good outside of
$HOME.

If you just want the current base directory:

PS1='${PWD##*/} > '

should do it.  You need the single quotes and I through in the ' > ' for
appearance.

--
Until later: Geoffrey		esoteric at denali.atlnet.com

It should be illegal to yell "Y2K" in a crowded economy.
	-- Larry Wall, creator of the programming language Perl






More information about the Ale mailing list