6
rated 0 times
[
6]
[
0]
/ answers: 1 / hits: 2915
/ 2 Years ago, mon, january 10, 2022, 10:57:45
If I have turned off execute permissions on hello.sh
and try to execute it
~$ sudo chmod 0666 hello.sh
~$ ./hello.sh
-bash: ./hello.sh: Permission denied
I get the permission error. But I can easily override that by using the .
or source
builtin.
$ . hello.sh
hello everyone
What's the purpose of setting the execute permission on a file if someone can override it using the source
builtin?
hello.sh
#!/bin/bash
echo 'hello everyone'
More From » command-line