Created
February 12, 2020 13:48
-
-
Save RashidJorvee/9e9de5c6f8fd2303d0438b492ee9ad33 to your computer and use it in GitHub Desktop.
If else and nested if else in Bash Shell scripting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Program in Bash Shell | |
CHECK_SOURCE="[main] INFO com.dobe.jcr.checknode.existence.App - Node exists" | |
echo $CHECK_SOURCE | grep -w -o -i 'Node exists' | |
if [ $? == 0 ]; then | |
echo " Node Exists" | |
echo $CHECK_SOURCE | grep -w -o -i 'checknode' | |
if [ $? == 0 ]; then | |
echo "checknode exist" | |
echo $CHECK_SOURCE | grep -w -o -i 'adobe' | |
if [ $? == 0 ]; then | |
echo "Adobe exist" | |
else | |
echo "Adobe doesnot Exist" | |
fi | |
else | |
echo "checknode doesnot Exist" | |
fi | |
else | |
echo "Node doesnot Exists" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment