In bash I can create a script with a here-doc like so as per this site: http://tldp.org/LDP/abs/html/abs-guide.html#GENERATESCRIPT
( cat <<\'EOF\' #!/bin
This is how I would do it:
sudo tee "$OUTFILE" > /dev/null <<'EOF' foo bar EOF