On Tue, Jul 13, 2010 at 8:22 PM, Greg Wooledge <wool...@eeg.ccf.org> wrote:
> On Tue, Jul 13, 2010 at 11:19:34AM +0800, Clark J. Wang wrote:
> > My PS1 depends much on PROMPT_COMMAND. For example, my PROMPT_COMMAND
> will
> > trim very long $PWD to a shorter one (depends on the window size of
> current
> > terminal):
> >
> > [r...@server ~/directory/loooooooong/very/a/is/this] #    ---->
> > [r...@server ~/.../very/a/is/this] #
>
> The same thing could be done with a command substitution inside PS1.
>

Agree. Actually my PROMPT_COMMAND does more than that, it'll also update a
few more vars. Too many command substitution in PS1 may affect the
performance, I think.

-Clark

Reply via email to