Authored by Derek Rodriguez

Fish-like path abbreviation in Bash

A Bash function that automatically abbreviates your PWD when it gets too long, the same way that the fish shell does. For example ~/Alpha/Bravo/Charlie/Delta/Echo becomes A/B/C/D/Echo. To use this function, put it in your PS1 where you'd normally put \w but surround it in backticks, so it should look something like this:

export PS1="`better_path` $"
Edited 512 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment