>> On Tue, 28 Sep 2010 09:42:40 -0400 (EDT), 
>> Stephen Powell <zlinux...@wowway.com> said:

S> I don't speak for the OP, but my guess is that the OP has a script that
S> he wants to be able to run either as his non-superuser self or as root.

   Easy.  This preserves arguments including spaces:

     #!/bin/sh
     PATH=/usr/local/bin:/bin:/usr/bin; export PATH
     test "`id -u`" -gt 0 && exec sudo $0 "$@"

     whoami
     for arg in "$@"; do
         echo "[$arg]"
     done
     exit 0

-- 
Karl Vogel                      I don't speak for the USAF or my company

EXCUSE FOR GETTING TO WORK LATE #7:
The dog ate my car keys.  We're going to hitchhike to the vet.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100928185441.e2d39b...@kev.msw.wpafb.af.mil

Reply via email to