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 04-14-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
Retested....
Code:
$ cat script
#! /usr/bin/ksh
#cd /the/directory
#exec > onebigoutputfile
find . -name index\*.html | while read fname ; do
           sed '1,/<TITLE> Section 440./d' < $fname
done
exit 0
$
$
$
$ cat index1.html
hhhh
kkkkk
hhhh <TITLE> Section 440.
jjjjj 5
jjjjjj8
jjjj6
iiii9
$
$
$
$
$
$ ./script
jjjjj 5
jjjjjj8
jjjj6
iiii9
$
I commented out the cd and the exec for easy testing. The only way your result makes sense is if each of your files contains a single line after the "seection 440" line and that single line is only the file name. I assume you can cut and paste accurately, so then it beats me...