^ - beginning of line
.* - acts as wildcard
$ - end of line
test..
# echo "A /test/test1/qa/test2/index.html
> A /test/test1/qa/test3/test.jpg
> A /test/test1/qa/test3/test1.jpg
> A /test/test1/qa/test4/test.swf
> html
> A
> html A
> A blah blah html" | grep ^A.*html$
A /test/test1/qa/test2/index.html
A blah blah html
#
You probably already noticed it, but don't forget to add "index." to that. I thought you were only looking for an html file and missed the fact that you need "index.html"
Consider that the index_A file is having the following content.
A /test/test1/qa/test2/index.html
A /test/test1/qa/test3/test.jpg
A /test/test1/qa/test3/test1.jpg
A /test/test1/qa/test4/test.swf
So the sed will search for that pattern and it will not delete that line.
Other lines will be deleted. So we can get.