I’m using Amazon Linux. I want to start a process provided one isn’t running already. This is a bash script I embed within a Jenkins Maven job. So I have
pids=$(pidof /usr/bin/Xvfb) if [ ! -n "$pids" ]; then Xvfb :0 -screen 5 1024x768x8 & fi
Unfortunately, if there is no process, the line “pids=$(pidof /usr/bin/Xvfb)” returns a failing exit code and none of the other lines following are executed. Is there a way I can write the above such that no failed exit codes will be returned?