cat redirect EOF missing text

Hello attempting to redirect out to create a startup script in solaris. The steps are working but the $1 entry is being left out. syntax below and content of output file below.

cat > S99build << EOF
> #!/bin/bash
> case $1 in
> 'start')
> /usr/os-buildsol.sh
>
> ;;
> esac
> exit 0
> EOF

The $1 is not coming across in the output file

cat S99build
#!/bin/bash
case  in
'start')
/usr/os-buildsol.sh

;;
esac
exit 0

Variables are substitued inside HERE documents.
Try this :

cat > S99build << EOF
> #!/bin/bash
> case \$1 in
> 'start')
> /usr/os-buildsol.sh
>
> ;;
> esac
> exit 0
> EOF

Jean-Pierre.

Try:

cat > S99build << "EOF"
> #!/bin/bash
> case $1 in
> 'start')
> /usr/os-buildsol.sh
>
> ;;
> esac
> exit 0
> EOF

By quoting EOF no expansions or substitutions are performed on the here document...

Thanks all, it's working.