You might want to consider creating an "Execute Shell Script" action programmatically in a macro, and then execute it. The reason for this is that you don't need to set any permissions when the script itself is inside a KM action.
You can use an Execute Shell Script action which contains the following: (where you use the full path of your file.)
chmod 777 /Users/myname/data/x.sh
The number 777 makes it so that Owner, Group and World all have read/write/execute action. You might want to narrow that down to the minimum permissions required.