Answer to Question #277009 in UNIX/Linux Programming for Himanshi

Question #277009

Write a shell script to compare two strings input by the user for equality.

1
Expert's answer
2021-12-11T05:52:04-0500
read -p "Enter a string: " str1
  
if [ $str1 == "linux" ]
then
    echo "linux"
elif [ $str1 == "unix" ]
then
    echo "unix"
else
    echo "Neither linux nor unix"
fi

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS