Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: volume label in prompt?
On Thu, 25 Oct 2012, Ray Andrews wrote:
Gentlemen,
I'm now running three machines here, each with several copies of various 
linii available.  It gets a bit confusing.  I'm wondering if there might be 
something I can add to my prompt that could help me remind myself where I'm 
at.  I'm open to any suggestions, but one idea I had was something to 
identify the volume label of the current root directory.  That would do it if 
it can be done. Can it?
Other people have offered some alternatives, but if you really want the 
volume label of the current root directory:
volume_label=$(eval "$(blkid -o export $(mount | awk '$3 == "/" { print $1 }'))" ; printf "%s" $LABEL)
`blkid` is a Linux thing, AFAIK.
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author