]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/functions
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 8 Mar 2019 14:16:45 +0000 (14:16 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 8 Mar 2019 14:16:45 +0000 (14:16 +0000)
etc/profile.d/functions

index c7cb60e27f5ec3331ab52942482f4af94a84bf58..cc00a9ba247069746d569a8614f3776df9ee420d 100755 (executable)
@@ -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