Have you tried something like that? I have added the $()
around your validate_html
so it'd be executed and not simply printed.
#!/bin/bash
cp "$1" tmpmulti
ex tmpmulti << 'HERE'
%s/.*/echo "&:" "$(validate_html &)"/
wq
HERE
/bin/bash tmpmulti
rm tmpmulti