From 4c9ada47e54887dadac8a97b79c2fbd74698ba2b Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 6 Feb 2017 22:18:37 +0000 Subject: [PATCH] etc/profile.d/mac.sh --- etc/profile.d/mac.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/profile.d/mac.sh b/etc/profile.d/mac.sh index 4e295630..caad7378 100644 --- a/etc/profile.d/mac.sh +++ b/etc/profile.d/mac.sh @@ -241,10 +241,13 @@ mac_port_reinstall() { } getent() { - which getent && (eval "$(which getent) $@"; return) - [ "$1" = 'group' -a -n "$2" ] && grep "^$1:" /etc/group && return - [ "$1" = 'group' ] && cat /etc/group && return - [ "$1" != 'passwd' ] && echo "Support only passwd and group untill now" && return 1 + local cmd; cmd=`which getent` && (eval "$cmd $@"; return) + if [ "$1" = "group" -a -n "$2" ]; then + grep "^$2:" /etc/group + return + fi + [ "$1" = "group" ] && cat /etc/group && return + [ "$1" != "passwd" ] && echo "Support only passwd and group untill now" && return 1 [ -z "$2" ] && (ls_users; return) ls_users | grep "^$2:" } -- 2.47.3