OT root can't sudo
Another way to do it would be to have the "invisible" sudo similar to
if [ "`id -u`" != 0 ] ; then
echo abc | $NEEDSUDO tee /tmp/t
Then, if the uid is not 0 (root), then it inserts the sudo line...If run by root, then NEEDSUDO is empty.
On Tue, Sep 28, 2010 at 5:42 PM, T o n g <firstname.lastname@example.org> wrote:
On Tue, 28 Sep 2010 16:14:24 +0200, Alois Mahdal wrote:
>>> I dont use sudo, but can you explain me,so I will go to bed with more
>>> knowledge, why root would need sudo?
>> invoking my scripts embedded with sudo as root
> I'm, not sure what you mean by "embedded" here, so my guess is that you
> mean making something like this work for both user and root: . . .
Thanks for the clear illustration. Yep, that's what I meant.
Besides, I share my aliases between my normal account and root account,
many of them are using sudo and I don't want to define two sets for the
Tong (remove underscore(s) to reply)
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact email@example.com