I am trying to check to see if a string exists inside a variable inside an if statement.
if [ -n $(echo "$RUN" | grep "Done running command.") ]; then
I know this can be done by creating another variable then checking if that is empty but I am trying to see if it can be done in a more streamlined way.
CHK=$(echo "$RUN" | grep "Done running command.")
if [ -n "$CHK" ]; then
Any incite on this would be helpful.