]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/mac.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 6 Feb 2017 22:18:37 +0000 (22:18 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 6 Feb 2017 22:18:37 +0000 (22:18 +0000)
etc/profile.d/mac.sh

index 4e2956301d291014ec0dcfdb6e944108596e7406..caad737871f72360ef18dc115419dde601841625 100644 (file)
@@ -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:"
 }