I wrote a script and I'm using a construction like this inside of it
FILES=($S_DIR/$OPTIONS), where i basically create an array of files. Like this:
This works fine for me, until the script runs against a 700 file/folder. Is there a way to call this particular line with
sudo? I can of course use
ls to get the file list. But I'd like to figure it out if this way is also possible too. Thanks!
I'm writing a check for Nagios and want check all files of specified type within of folder. All files I want to check have 700 rights on them, so the
nagios user can't read them. And array
FILES is not bound in the end. And i can't check the desired file propertys.
So I'm searching for way to populate
FILES=($S_DIR/$OPTIONS) without external utility like
ls. My script works on files/folders there the user have rights. In short: I need to elevate the rights for only this line in the my script: