multiple if condition in shell script

 #!/bin/bash

echo "Type 1 for stage"

echo "Type 2 for prod"

echo ""

read -p "Type your value: " Env

echo $Env

if [ $Env -eq 1 ];

then

        echo "Stage"

elif [ $Env -eq 2 ];

then

        echo "Prod"

else

        echo "Invalid Value"

fi

Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment