I'm writing a script to update an application and am running into something strange with ps aux.
If I run the processNum variable locally without the application open, it returns 1.
If I run the processNum variable through the script without the application open, it returns 4
If I run the processNum variable locally with the application open, it returns 3
If I run the processNum variable through the script with the application open, it returns 6.
Does anyone know why it appears to be adding 3 to the value when being run as a bash script? See below for what I'm doing.
processNum=$(ps aux | grep "Jabber" | wc -l)
# If Jabber is not open, remove and install new version
if [ $processNum -lt 5 ]; then
rm -rf /Applications/Cisco Jabber.app
/usr/local/jamf/bin/jamf policy -trigger customtriggerhere
else
echo "hi"