I'm looking for a way to force my PS1 variable to a certain number of chars.
It currently looks like:
$PS1="\W $"
and I'm trying to keep the same number of characters regardless of the length of current folder name.
For example, both Documents and bin would be displayed as 10 character strings, keeping the left side of my terminal the same width all of the time.

echo 12345 | awk '{substr($0, 1, 10)}'. How to stuff it into $PS1, I have no idea. – new123456 Jun 22 '11 at 21:03bashhas thePROMPT_COMMANDvariable, but it doesn't have the same semantics asPS1(notably the escape characters).zshcan do this withPROMPT(it evaluates at every run). – new123456 Jun 23 '11 at 15:11