From 7ccc2ce843ad1983432fc4f6c573b676e8abde06 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 8 Mar 2019 14:16:45 +0000 Subject: [PATCH] etc/profile.d/functions --- etc/profile.d/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index c7cb60e2..cc00a9ba 100755 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -4,14 +4,14 @@ # ################################################################################# type -P which > /dev/null || which() { type -P "$1" 2>&1; } -type -P nproc > /dev/null || nproc() { +which nproc > /dev/null || nproc() { case "$OSTYPE" in darwin*) sysctl -n hw.ncpu ;; *) awk '/^processor/ {++n} END {print n}' /proc/cpuinfo ;; esac } -type -P timeout > /dev/null || timeout() { +which timeout > /dev/null || timeout() { local p if p=`which timeout 2>/dev/null`; then $p $@ @@ -20,7 +20,7 @@ type -P timeout > /dev/null || timeout() { fi } -type -p seq > /dev/null || seq() { +which seq > /dev/null || seq() { local begin=1 local end local step=1 -- 2.47.3