I've written a shell script, called keepAbcdRunning, whose job it is to check whether command / process 'abcd' is running and if it isn't, to start it.
keepAbcdRunning has the form:
#!/bin/bash if pgrep -x $1 > /dev/null then echo "$1 is running" else echo "calling $2" $2 fi exit 0
As I've written it, keepAbcdRunning needs two input arguments,
$1 is the command / process name to check and
$2 is the command needed to start abcd.
abcd itself is a script which executes an application that takes a Json formatted string as input. If I wanted to call abcd directly from a terminal, I'd call:
However, I seem to be unable to pass the character sequence in such a way that abcd.sh is called correctly from within keepAbcdRunning....