remove_cruft() { ... sed, sed, awk! awk! awk! } cat $HTML_FILE | remove_cruft >$OUTPUT_FILE