maybe
maybe copied to clipboard
Check if script is executable in first place
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 ?