From: Nicolas Boisselier Date: Mon, 6 Feb 2017 21:35:24 +0000 (+0000) Subject: etc/profile.d/mac.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=2c6978ea98ec3985070b69622b5125f8d4ff47f6;p=nb.git etc/profile.d/mac.sh --- diff --git a/etc/profile.d/mac.sh b/etc/profile.d/mac.sh index 1b50cae2..c72268fe 100644 --- a/etc/profile.d/mac.sh +++ b/etc/profile.d/mac.sh @@ -25,8 +25,8 @@ case "$OSTYPE" in darwin*) alias strace='dtruss' alias updatedb='sudo sh -c "cd / && exec /usr/libexec/locate.updatedb"' -if ! which seq 1>/dev/null; then seq() { + which seq && (eval "$(which seq) $@"; return) if [ -n "$2" ]; then jot - "$1" "$2" else @@ -241,7 +241,7 @@ mac_port_reinstall() { rm /tmp/myports.txt } -not_darwin() { +is_darwin() { case "$OSTYPE" in darwin*) return 0 ;; *) return 1 ;; @@ -249,9 +249,8 @@ not_darwin() { } getent() { - not_darwin && (eval "$(which getent) $@"; return) - local db=$1; shift - [ "$db" != 'passwd' ] && echo "Support only passwd untill now" && return 1 + which getent && (eval "$(which getent) $@"; return) + [ "$1" != 'passwd' ] && echo "Support only passwd untill now" && return 1 [ -z "$2" ] && (ls_users; return) ls_users | grep "^$2:" }