Here Docs

cat << EOF > filename.sh
#!/bin/bash -e

# bunch of scripty stuff
##

EOF