1

shell script bits & pieces thread

view story
linux-howto

http://crunchbang.org – The thread is old, but this stuff doesn't go out of date so fast...I hit a problem yesterday when a script, running as normal user, wanted to check a system folder and take some action if it didn't exist:[[ -d /path/to/folder ]] || return_errorUnfortunately the folder 'to' belongs to root, and permissions are 700, so the script is not allowed to look inside to see 'folder', so the test always fails.One way out would be to run the whole script as root but that would cause problems elsewhere, eg every file it made would belong to root...Another way is to run the com (HowTos)