Last active
August 29, 2015 14:27
-
-
Save mej/881bee1fe84b8e94da60 to your computer and use it in GitHub Desktop.
[P1L] Alphabetize non-system group members in /etc/group (in-place edit)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -ni.presort -e '@F = split /:/; $F[3] = join(",", sort(grep{$_}split(",", (chomp($F[3]),$F[3]))))."\n" if ($F[2] >= 100); print join(":", @F);' /etc/group |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This PERL 1-liner (P1L) will alphabetize the list of group members for all groups in
/etc/group
with GID >= 100.