[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#34672: [RFC] id --numeric
From: |
Bernhard Voelker |
Subject: |
bug#34672: [RFC] id --numeric |
Date: |
Thu, 28 Feb 2019 08:22:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
severity 34672 wishlist
tags 34672 notabug
stop
On 2/26/19 9:36 PM, Giuseppe Scrivano wrote:
> Hi,
>
> there are cases where I'd like to see only the numeric values in the
> `id` output.
>
> I could get this information separately, but having a new option
> and just one command simplifies the task.
>
> Are you fine with a change like the following?
>
> If you have nothing against it, I will clean it up and send it again.
>
> Thanks,
> Giuseppe
Thanks for the patch.
What is the use case? I mean, if one wants only the numeric numbers,
then this is usually in a script for automatic processing, and then
I thinks it's clearer to have uid and group/groups separated:
$ id -u
1000
$ id -g
100
$ id -G
100 454 457 480 492
There's even a -z option to separate by NULs instead of white space.
And, when still needing all in the same output, one could filter like e.g.:
$ id | sed 's/([^)]*)//g'
uid=1000 gid=100 groups=100,454,457,480,492
So I'm currently 40:60 to add it.
Thanks & have a nice day,
Berny