bash - How to know if a process is going to get "Permission denied" -


me@ubuntu:~$ cat /proc/10/syscall cat: /proc/10/syscall: permission denied 

i want know ahead of time if have permission access syscall.

i tried this:

file=/proc/$n/syscall     if [ -r $file ];         cat /proc/$n/syscall     else         echo "can't read"     fi 

but it's not working.

any ideas?

thanks.


Comments

Popular posts from this blog

python - Alternative to referencing variable before assignment -

vb.net - How to ignore if a cell is empty nothing -

Sort a complex associative array in PHP -