Skip to content

Instantly share code, notes, and snippets.

@djtech42
Last active August 29, 2015 14:27
Show Gist options
  • Save djtech42/e1b0cc030b208b978538 to your computer and use it in GitHub Desktop.
Save djtech42/e1b0cc030b208b978538 to your computer and use it in GitHub Desktop.
Warn if there is more than one instance of Xcode running (Ex. Xcode and Xcode Beta are running at the same time)
#!/bin/bash
NUMOFLINES=`pgrep -ax Xcode | wc -l `
if [ $NUMOFLINES -eq 1 ]
then
echo "Everything's fine. Only one instance of Xcode running."
elif [ $NUMOFLINES -eq 0 ]
then
echo "No instances of Xcode are running."
else
echo "Warning! $NUMOFLINES Xcode instances running"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment