linux - Why do we need execution permission although we can run any script without it using "bash script file"? -


i wondering when , why need execution permission in linux although can run script without execute permission when execute script using syntax bellow?

bash somescriptfile 

not programs scripts — bash example isn't. need execute permission executable programs.

also, when bash somescriptfile, script has in current directory. if have script executable , in directory on path (e.g. $home/bin), can run script without unnecessary circumlocution of bash $home/bin/somescriptfile (or bash ~/bin/somescriptfile); can run somescriptfile. economy worth having.

execute permission on directory different, of course, important. permits 'class of user' (owner, group, others) access files in directory, subject per-file permissions allowing that.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -