Now, about Linux, what exactly should I do?
You need to do two things:
1. Add a line (the so-called "shebang") at the beginning of the script specifying which interpreter should run it; here is an example of a Hello world script for sh:
Qt Code:
  1. #!/bin/sh
  2. echo "Hello world"
To copy to clipboard, switch view to plain text mode 
Depending on what you want to do you might leave that to the user of your application.
2. Make the script executable by its owner. See QFile::setPermissions().