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 -->
  #1 (permalink)  
Old 10-10-2008
yale_work yale_work is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 28
Find a string in a file

What is wrong in this:
One file in /tmp is test.txt...file has three rows as follows:

YES I M HERE
12345
67890

Second file test2.txt:

status = `grep -i "YES I M HERE" /tmp/test.txt`
print "$status"

if we execute test2.txt It is returning 'status' not found

Last edited by yale_work; 10-10-2008 at 03:28 PM..