#! /bin/bash
echo “enter string 1″
read str1
echo $str1
echo “enter string 2″
read str2
if [[ $str1 == $str2 ]]
then
echo $str1 and $str2 matched
else
echo $str1 and $str2 not matched
fi
exit 0
#! /bin/bash
echo “enter string 1″
read str1
echo $str1
echo “enter string 2″
read str2
if [[ $str1 == $str2 ]]
then
echo $str1 and $str2 matched
else
echo $str1 and $str2 not matched
fi
exit 0
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
Kindly mention what kind of issue you are facing in this script?
if i put only single square brackets in if statement, and pass hello hello in a single string and other hell hell in second string… it doesnt make make any comparison.. in short, it doesnt compare with space .. but when i put double square brackets [[]] ..it works fine .. whats the need of second brakets..