I want to write in a bash script a piece of code that checks if a program is already running. I have the following in order to search whether bar is running
foo=`ps -ef | grep bar | grep -v grep` || true