maybe icon indicating copy to clipboard operation
maybe copied to clipboard

Check if script is executable in first place

Open kaustubhhiware opened this issue 7 years ago • 0 comments

To test maybe, I wrote a simple script

$ cat demo.sh 
rm -rf temp123
mkdir temp123
$ maybe ./demo.sh
- Error executing ./demo.sh: [Errno 13] Permission denied.
$ sudo maybe ./demo.sh
- Error executing ./demo.sh: [Errno 13] Permission denied.

I tried giving it the appropriate rights

$ sudo chmod 777 demo.sh 
$ sudo maybe ./demo.sh
- Error executing ./demo.sh: [Errno 8] Exec format error.

I added the line #!/bin/sh to the top, and this gave the desired output.

$ sudo maybe ./demo.sh
maybe has prevented ./demo.sh from performing 2 file system operations:

  delete pwd/temp123
  create directory pwd/temp123

Do you want to rerun ./demo.sh and permit these operations? [y/N] n

Is it possible to detect, if the script could have been run in the first place, instead of showing these errors ?

kaustubhhiware avatar Jun 03 '17 13:06 kaustubhhiware