[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sed problem



On Sun, Oct 19, 2003 at 11:37:44AM +0100, Dave selby wrote:
> I need to get the contents of a HTML title tag & put it in a string.
> 
> ie
> <title>specialist cards</title>
> 
> I need the "specialist cards" in  a variable $titlecontents
> I thought it would be easy with sed
> 
> sed -n '/<title>/,/<\/title>/p'
> 
> But no go. I have tried various ways but to no avail.
> 
> Any ideas ?

I'm sure this is not the pukka way to do it but 

for jim in html_file_directory/*; do grep \<title\> $jim | sed 's/.*<title>//' | sed 's/<\/title>.*//'; done > file_list.txt

puts all the titles from the scripts in html_file_directory into 
file_list.txt.

> 
> Dave
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact 
> listmaster@lists.debian.org
> 



Reply to: