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
Try to make so:
ps auxw | grep -v grep | cat
cat returns always 0 and ignores exit code of grep