The name of the file is up to the standards you have for your system. Ususally coders use filename.sh. Unix is not Windows so it doesn't care about file extensions.
To make the code run under ksh do two things
1. change script to have a shebang "#!" as the VERY FIRST line in the script
2. change permissions on the file - in this example we call the script filename.sh
Code:
chmod +x filename.sh
to run the script, just type the name of the script file and press return.