Search This Blog

Monday, October 2, 2023

Shell script 19

Question: write a script to print your lucky number

Answer:

#!/usr/bin/bash

read -p "What is your lucky number?" num

case  $num in

        1)

                echo "your lucky number is one";;

        2)

                echo "Your lucky number is two";;

        *)

                echo "None"

esac

Output:

kalam@DESKTOP-OSJTLNE:~$ sh  case_statement.sh

What is your lucky number? 1

your lucky number is one

No comments:

Post a Comment

What is the sanity checks you have done for STA?

 Sanity checks for STA: Linking Checks: We need to check., is there any missing modules or missing pins in a library. this is done by link c...