I'm searching for a command which only says if the current user has r-rights (read) on the file passed as a parameter.This command could be something like haveIRights -x <file> and it has to only return explicitly yes or not.Is there a command like this?
A command showing if I have the right to perform writing?
shell script;files;permissions
See the Wooledge wiki on tests and conditionals:-w FILE: True if the file is writable by you.So, you could test it with:[[ -w $file ]]If you aren't using bash, you could equally use [ -w $file ]