Search This Blog

Sunday, October 1, 2023

Shell script 9

Question:

String length is empty or not

Answer:

#!/usr/bin/bash

mystring="I love my country"

if [ -z "${mystring}" ]

then

        echo "mystring length is not zero"

else

        echo "$mystring"

fi

Output:

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

I love my country

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...