Re: How to run something before invoking the inputted command?
From:
Greg Wooledge
Subject:
Re: How to run something before invoking the inputted command?
Date:
Tue, 13 Jul 2010 08:22:38 -0400
User-agent:
Mutt/1.4.2.3i
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):
>
> [root@server ~/directory/loooooooong/very/a/is/this] # ---->
> [root@server ~/.../very/a/is/this] #
The same thing could be done with a command substitution inside PS1.