Despite of commentary at actions/prepare-environment.sh virtualbox script calls which in several places:
# grep -rn which *
actions/prepare-environment.sh:22:# We are avoiding using 'which' because of http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
actions/prepare-environment.sh:70:sshs=`which ssh | wc -l`
actions/prepare-environment.sh:89: ipconfigs=`which ipconfig | wc -l`
functions/memory.sh:25: if [ "$(which free)" != "" ]; then
functions/memory.sh:28: elif [ "$(which top)" != "" ]; then
functions/memory.sh:36: if [ "$(which sysctl)" != "" ]; then
functions/memory.sh:45: if [ "$(which free)" != "" ]; then
functions/memory.sh:48: elif [ "$(which top)" != "" ]; then
In all places we should use type instead of which:
type foo >/dev/null 2>&1
Fix proposed to branch: master /review. openstack. org/151676
Review: https:/