Sudoers list?

Daniel Carrera daniel.carrera at zmsl.com
Wed Apr 5 09:08:12 UTC 2006


Matt Palmer wrote:
> if [ ! -w "$INSTDIR" ]; then
> 	cat <<EOF
> You do not have permission to install this program into the destination you
> have chosen.  Please select a different location or run this script again
> using sudo.
> EOF
> 	exit 1
> fi

I think that's my best bet.

>>Another difference applies to well-intentioned but buggy scripts. When 
>>you trust the script writer's intentions, but not his coding skills :) 
>>it doesn't hurt to minimise the time spent as root.
> 
> There is that.  Nothing like a bit of
> 
> rm -rf /$INSTDIR
> 
> without checking [ -n "$INSTDIR" ] first to really make somebody's day.

What does [ -n do?
I assume that it checks whether $INSTDIR is not empty.

Cheers,
Daniel.
-- 
      /\/`) http://opendocumentfellowship.org
     /\/_/
    /\/_/   A life? Sounds great!
    \/_/    Do you know where I could download one?
    /




More information about the ubuntu-users mailing list