if and sed statement

this is my output for my crawler.

/about.html
/ads/
/advanced_search?hl=en

groups.google.com/grphp?hl=en&tab=wg&ie=UTF-8
/imghp?hl=en&tab=wi&ie=UTF-8
/intl/en/options/
/language_tools?hl=en
/maphp?hl=en&tab=wl&ie=UTF-8
news.google.com/nwshp?hl=en&tab=wn&ie=UTF-8
/preferences?hl=en

/services/

what i am trying to do is add the website to the beginning of the output
e.g: for instance the first line of the output reads "/about.html" then after the website is added this is what it would read "Google - About Google, Our Culture & Company News" i am trying to pass the website through variable "$1". and i am trying to write an if statement to where if the output has "/" in front at the begnning it would add $1 {www.google.com} it will add and if it does'nt it will leave it alone. can anyone help?

#!/bin/ksh

prefix='www.google.com'

sed "/^\//s/^/${prefix}/" myFile

Thanks alot it worked :slight_smile:

Downloaded: 2,548 bytes in 1 files
/about.html
/ads/
/advanced_search?hl=en

groups.google.com/grphp?hl=en&tab=wg&ie=UTF-8
/imghp?hl=en&tab=wi&ie=UTF-8
/intl/en/options/
/language_tools?hl=en
/maphp?hl=en&tab=wl&ie=UTF-8

/preferences?hl=en

/services/

www.google.com/advanced_search?hl=en

groups.google.com/grphp?hl=en&tab=wg&ie=UTF-8

www.google.com/maphp?hl=en&tab=wl&ie=UTF-8

www.google.com/preferences?hl=en

www.google.com/services/

Say you wanted to wget each line of chris's output, and store the data just as he has, how would you go about doing this? Say for instance: wget Google - About Google, Our Culture & Company News (throw in a few sed and greps to get the same output). then to the next line of Chris1234 output and so on. I guess my question is more focused on writing a recursive function. If Chris1234 did this, that would make is program more self sustaining, but thats if thats what he's looking for? So can anyone help?