From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22341 invoked by alias); 26 Oct 2012 16:14:12 -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: 17352 Received: (qmail 3456 invoked from network); 26 Oct 2012 16:14:09 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.10 as permitted sender) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.0 cv=Qa8dTrnv c=1 sm=1 a=sgO5gNtQRqEA:10 a=3hYtqE4e7KUA:10 a=8nJEP1OIZ-IA:10 a=BaYxnc4IozAA:10 a=ob-6zafPzql_3QLvnHgA:9 a=wPNLvfGTeEIA:10 a=/bLbuBD0lrv91xL1PDQKaA==:117 Message-id: <508AAFC3.8070300@eastlink.ca> Date: Fri, 26 Oct 2012 08:44:03 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: volume label in prompt? References: <50895F66.9050407@internecto.net> <20121025172732.56a44ed2@pwslap01u.europe.root.pri> <5089C812.6030504@eastlink.ca> In-reply-to: Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit On 26/10/12 06:44 AM, Benjamin R. Haskell wrote: > 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. > Cool, thanks all.