From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22930 invoked by alias); 26 Oct 2012 13:50:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17351 Received: (qmail 18780 invoked from network); 26 Oct 2012 13:50:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Fri, 26 Oct 2012 09:44:46 -0400 (EDT) From: "Benjamin R. Haskell" To: Ray Andrews cc: zsh-users@zsh.org Subject: Re: volume label in prompt? In-Reply-To: <5089C812.6030504@eastlink.ca> Message-ID: References: <50895F66.9050407@internecto.net> <20121025172732.56a44ed2@pwslap01u.europe.root.pri> <5089C812.6030504@eastlink.ca> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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