The cat file. TXT
ABC
Def
Ghi
====================
The cat file. TXT | while read the line; Do
If the [[${line} - eq "ABC"]]. Then
Echo "yes"
The else
Echo "no"
Fi
The done
Typing is yes, like a statement didn't work, don't know what's the matter, for a great god grant instruction!!!!!
CodePudding user response:
Eq is used for comparison of integer, string comparison with=directly by the${line}="ABC"
CodePudding user response:
Eq is the comparison of the integerString comparison==
The cat file. TXT | while read the line; Do
If the [[${line}=="ABC"]]. Then
Echo "yes"
The else
Echo "no"
Fi
The done