You just write the commands in a text file. No compilation required.
The file should start with
then just have each command on its own line. To make the script executable, do 'chmod +x /path/to/script'.
To have the script run automatically, have a look in ~/.kde . There should be a directory called 'Autostart'. Just stick the script in there.