I have a String of command as below:
CMD_LAUNCH="launch.sh \
-v $ABC_VERSION \
-p something \
-X $MAX_HEAP_SPACE_PARAM \
-Dpersist false \
-DanotherPasram Abc"
I will launch this command in ksh as below:
$CMD_LAUNCH
How can I make sure the command has -Dpersist false ?
I want to cover the cases where there can be any no of spaces between -Dpersist and false. but my attempt fails to accomplish this.
Try 1)
if [[ "$CMD_LAUNCH" = *"Dpersist\s+false"* ]]
then
echo "It's there!"
else
echo "It's not there!"
fi
I want to test if Dpersist false is present in command.