I need to test this:
kill -0 $LAST_PID;
So I wrote
if [ kill -0 $LAST_PID ] ; then ...
But this results in an error -
unknown operator after - or so.
how do I escape the options within
if that you're trying to escape it from, it's
[. But you aren't testing the executing of
kill that way; you're testing strings. You want:
if kill -0 "$LAST_PID"; then ...
that will test
kill's return code.