From 835c0a8236a6ee923355cc6d81c1a52d5aa06d58 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 6 Feb 2017 21:33:49 +0000 Subject: [PATCH] etc/profile.d/mac.sh --- etc/profile.d/mac.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/etc/profile.d/mac.sh b/etc/profile.d/mac.sh index 09f07809..1b50cae2 100644 --- a/etc/profile.d/mac.sh +++ b/etc/profile.d/mac.sh @@ -240,4 +240,20 @@ mac_port_reinstall() { curl -s https://svn.macports.org/repository/macports/contrib/restore_ports/restore_ports.tcl | sh /tmp/myports.txt rm /tmp/myports.txt } + +not_darwin() { + case "$OSTYPE" + in darwin*) return 0 ;; + *) return 1 ;; + esac +} + +getent() { + not_darwin && (eval "$(which getent) $@"; return) + local db=$1; shift + [ "$db" != 'passwd' ] && echo "Support only passwd untill now" && return 1 + [ -z "$2" ] && (ls_users; return) + ls_users | grep "^$2:" +} + ;;esac # Darwin only ! <<< -- 2.47.3