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 11-22-2007
amitrajvarma amitrajvarma is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 43
Search for strings & copy to new file

Hi All,

I am just learning shell programming,

I need to do the following in my shell script.

Search a given log file for two\more strings.

If the the two\more strings are found then write it to a outputfile else
if only one of the string is found, write the found string in one output file
and others in other output file.

Is it possible to do it? If so please share the code

Thanks

Amit