#!/usr/bin/env bash while : do date uptime case "`uname -s`" in SunOS) ptree > $(timesecs | awk ' { print $1 }') ;; Linux) ps axf > $(timesecs | awk ' { print $1 }') ;; *) # try to find hps, otherwise just us ps if type hps > /dev/null 2>&1 then hps > $(timesecs | awk ' { print $1 }') else ps -ef > $(timesecs | awk ' { print $1 }') fi ;; esac sync sync sync sleep 60 done # *) # ps -ef > $(timesecs | awk ' { print $1 }') # ;; # never) # hps > $(timesecs | awk ' { print $1 }') # ;;