I'm new to Shell scripting and I have created the below to run a script and get the output and print a msg based on the output.
#!/bin/bash
OUTPUT=$(sh ./myprocess.sh | tail -1)
echo $OUTPUT
if [[$OUTPUT == *"\"process\":\"ACTIVE\""* ]]; then
echo "Process Active"
else
echo "Process Down"
fi
The echo
prints the output but my script fails saying "command not found a line 4"