[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
who: sorted output + minor usage change
From: |
Assaf Gordon |
Subject: |
who: sorted output + minor usage change |
Date: |
Fri, 06 Feb 2015 21:04:20 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Hello,
Two suggestions for 'who':
first,
the --help text for '-u/--users' option is not clear (IMHO).
'who --help' says:
-u, --users list users logged in
Whereas the Coreutils manual says:
"-u => After the login time, print the number of hours and minutes that the user has
been idle. [...]"
And posix says (
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/who.html ):
"-u => Write "idle time" for each displayed user in addition to any other
information. [...]".
so, except in the --help text, it talks about showing idle time.
Perhaps consider slightly modifying the usage text? (that's the first patch
attached).
second,
would you consider adding a 'sort' option to sort output by different fields?
The attached patch implements this.
examples:
who -a --sort=idle
who -a --sort=name
who -a --sort=line
Normally, piping to 'sort' should be enough, but the fields output by 'who' are
not fixed, so sorting with whitespace delimiters is tricky,
and sorting by exact character position is messy, and depends on the option
used.
Also, for sorting by idle time, the field conains mixed digits and characters (e.g. "."
for recently active, and "old" for not active) - not easily sorted.
comments are welcomed,
- Assaf
who-sort.patch
Description: Text Data
- who: sorted output + minor usage change,
Assaf Gordon <=