1

One of my script is making new .sh files in /tmp/ folder how can I setup that all new files in /tmp/ folder will get chmod -x automaticaly because my script is failing when trying to run scripts in /tmp/

John
  • 23

1 Answers1

2

Wrong approach. While creating the script, set the x flag as well! Or, when executing the created script, prepend sh or bash to it:

Instead of:

/tmp/myscript.sh

use:

bash /tmp/myscript.sh

Like that you don't have to make the script executable.

Frantique
  • 8,493