Code: chmod +x filename makes a file executable. The file system needs to be mounted with the exec option. The Mydocs partition is mounted noexec by default, so your script should be stored someplace else if it is on Mydocs. For elaborate logic flow, you might want to consider perl or python. perl can invoke OS commands with Code: system "command options arguments"; or Code: `command options arguments`;
chmod +x filename
system "command options arguments";
`command options arguments`;