| Posted by Roy Schestowitz on 06/12/07 11:18 
Toby Inkster wrote:
 > Roy Schestowitz wrote:
 >
 >> If there exists a command-line tool that will add string X after a
 >> regular expression Y is detected, _and_ apply this to /all/ files, then
 >> I'd be a happy puppy.
 >
 > sed -i 's/<head>/<head><title>Hello World<\/title>/i;' *.html
 
 Thanks a bunch Toby! Somehow I knew you'd be the most suitable person to
 help.
 
 Along with the following I can now manipulate things the way I wanted.
 
 exec 3<&0
 find . -type d -print |
 while read dirname
 do
 (cd $dirname
 exec 0<&3
 "$@"
 )
 done
 exec 3<&-
 
 
 --
 Roy S. Schestowitz
 http://Schestowitz.com
  Navigation: [Reply to this message] |