shell script condition parameter

 

#/bin/bash

FIRST_NAME=$1

LAST_NAME=$2

SHOW=$3

if [ "$SHOW" = "true" ]; then

        echo "Hello, $FIRST_NAME $LAST_NAME"

else

        echo "If you want to see the name, please mark the show option"

fi

 

Run script

./script.sh Penguin Technology true

Share on Google Plus

About Md. Shahzad Alam

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