diff options
Diffstat (limited to 'src/share/common')
-rw-r--r-- | src/share/common | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/share/common b/src/share/common index c88857e..8e2232d 100644 --- a/src/share/common +++ b/src/share/common @@ -484,6 +484,12 @@ get_homedir() { eval "echo ~${uname}" } +# return the primary group of a user +get_primary_group() { + local uname=${1:-`whoami`} + groups "$uname" | sed 's/^..* : //' | awk '{ print $1 }' +} + ### CONVERSION UTILITIES # output the ssh key for a given key ID |