The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #4 (permalink)  
Old 07-29-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Only coincidentally, actually. The addition of the square brackets is probably not correct, if I managed to understand your requirements.

You are trimming whitespace with tr -d ' ' -- are we to infer that spaces are allowed in the file before or after the match, on the same line?

Code:
grep "^ *$l_string *$" $l_tmp_file
If you don't want to allow spaces, remove both occurrences of space, asterisk.