Can you figure out what sed 's/.../.../g' means? What do 's' and 'g' stand for?
If you apply the previous substitution to the $HW: what do you get?
wget http://www.inf.ed.ac.uk/teaching/courses/inf1-cg/labs/lab4/HelloWorld.txt HW=HelloWorld.txt substitute $HW