1
2
I am on Lubuntu and I am using bash. My PS1 (in .bashrc) is :
PS1="\w> "
I like it because I need to paste the working directory all the time. The problem is that the path is always very long and since I use terminator I only have half of my screen's width available to display it... it is ugly and annoying. My command prompt looks like that :
/this/is/a/very/long/path/that/i/want/to/make/shorter >
I'd like to set in my environment variables :
$tiavl=/this/is/a/very/long
And then I'll get :
$tiavl/path/that/i/want/to/make/shorter >
The goal is to have something shorter in the command prompt but I still want to be able to copy paste it and do :
cd $tiavl/path/that/i/want/to/make/shorter
It is a bit like with $HOME :
~/path/that/i/want/to/make/shorter >
I know where I am and I can copy paste the ~.
Thanks.
Seems good to me. A question : if I want to have several prefix paths, I can not see how it can work. I write some bash scripts but I am not confident with string manipulation... I am reading your link. – mthpvg – 2012-10-26T11:13:18.867
The demo of Mat completely answers my question. Thanks Mat. I was understanding the substitution with the link he gave. – mthpvg – 2012-10-26T11:27:04.100