Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Inserting Lines into HTML Header

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

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index