public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Conrad <mconrad@intellitree.com>
To: "Ted Ts'o" <tytso@mit.edu>
Cc: util-linux@vger.kernel.org
Subject: Re: blkid -o value
Date: Tue, 27 Mar 2012 13:52:51 -0400	[thread overview]
Message-ID: <4F71FE73.9010208@intellitree.com> (raw)
In-Reply-To: <20120327173149.GC10142@thunk.org>

On 3/27/2012 1:31 PM, Ted Ts'o wrote:
> On Tue, Mar 27, 2012 at 01:26:14PM -0400, Michael Conrad wrote:
>> I would request that either the order of fields become stable by
>> printing empty lines for missing fields (and documented), or the "-o
>> value" be done away with, since I can't see any reason anyone would
>> want random output in a script-friendly format, and the fact that it
>> exists is likely to lead people astray.
> Try using this way, which was its intended usage:
>
> blkid -o value -s TYPE -t UUID=a3dc6f56-da22-4079-bf75-1fa2ce1aa4b0
>
> (replace part following -t with the search criteria you want; for
> example, "-t LABEL=backup").
>
> It was intended to be used a script-friendly way, and I believe there
> are shell scripts using in this fashion.  So please don't change blkid
> -o value.

I see how that could be useful if and only if you use exactly one "-s", 
but if you requested more than one "-s" they still come out in 
non-stable order.  It's like running a SQL query and having all the 
columns shifted because the first one was a NULL.  If you're on a system 
where all the volumes have labels, types, and uuids (and nothing else) 
it's very misleading.

At the very least, I would appreciate it if the man page mentioned that 
"-o value" should only ever be used with exactly one "-s".

-Mike

  reply	other threads:[~2012-03-27 17:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 17:26 blkid -o value Michael Conrad
2012-03-27 17:31 ` Ted Ts'o
2012-03-27 17:52   ` Michael Conrad [this message]
2012-03-27 18:43     ` Ted Ts'o
2012-03-28  9:00       ` Karel Zak
2012-03-28 21:03         ` Michael Conrad
2012-03-28  7:34 ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F71FE73.9010208@intellitree.com \
    --to=mconrad@intellitree.com \
    --cc=tytso@mit.edu \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox