The below code snippet shows how to compare two strings
#!/bin/ksh
str1="Chidam";
str2="Chidam";
if [ "$str1" = "$str2" ] ; then
echo -e "String str1 and str2 are same"
echo -e "string1=$str1 and string2=$str2"
fi
str1="Chidam";
str2="Chidamk";
if [[ "$str1" != "$str2" ]] ; then
echo -e "String str1 and str2 are not equal"
echo -e "string1=$str1 and string2=$str2"
fi
OUTPUT :
-bash-3.2$ sh str_comp
String str1 and str2 are same
string1=Chidam and string2=Chidam
String str1 and str2 are not equal
string1=Chidam and string2=Chidamk
= --> EQUAL OPERATOR
!= --> NOT EQUAL OPERATOR
A Language is not worth knowing unless it teaches you to think differently.
Subscribe to:
Post Comments (Atom)
Item - Category Query
SELECT msi.segment1 AS Item_Code, msi.DESCRIPTION AS Item_Desc, mcs.CATEGORY_SET_NAME, mck.CONCATENATED_SEGMEN...
-
1. To download Ldt file for a Concurent Program FNDLOAD [username]/[password] O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_nam...
-
The profile information available in the HZ_CUSTOMER_PROFILES can be created in three levels namely Party, Customer Account and Customer...
-
Here the article will describe about how to register WebADI to Responsibility menu Go to System Administrator --> Security --> Respo...
No comments:
Post a Comment