Thread: grep in perl

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    2
    Rep Power
    0
    I'm writing a little script that dynamically creates links to html files in a directory (and sub-directories). This all works great. However I want the text of the links to be the title in the html page.
    I thought of using grep (the unix command - NOT the perl function) to pull out the title. However I can't seem to get grep to create any output.
    Has any body got any ideas? Or other ways of doing it? I could specifically open every file but I want it to be as quick as pos.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    2
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $title = `grep -i '<title>' "$dir/$result"`;
    [/code]

IMN logo majestic logo threadwatch logo seochat tools logo