In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .
cat <<EOF><< myscript'EOF' > test
echo "First arg: $1"
echo "Second arg: $2"
echo "List of all arg: $@"
EOF
sh myscripttest hello world
More maybe found in the shell (sh) manual at http://heirloom.sourceforge.net/sh/sh.1.html