The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-28-2008
CAGIRL CAGIRL is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 18
Question How do I search a File for a string exact match

Hi, Can you help please.

I have the following comand:
if [[ `grep $l_string $l_tmp_file | tr -d ' '` = $l_string ]]; then
l_valid_string="Y"
fi
The problem I am trying to solve is that my l_string = ABC and my file contains
ABC
ABC_EFG

I only want back the value ABC exact match.