On Tue, 28 Sep 2010 03:26:42 +0200, T o n g <mlist4sunt...@yahoo.com>
wrote:
On Tue, 28 Sep 2010 02:58:05 +0200, Thierry Chatelet 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:
u...@machine ~/$ cat > aptupgscript.sh <<EOF
#!/bin/sh
echo Hello
sudo aptitude update
sudo aptitude upgrade
echo Update done by `whoami` || tee ~/done.log
EOF
u...@machine ~/$ chmod a+x aptupgscript.sh
u...@machine ~/$ ./aptupgscript.sh
Hello
Update done by user
u...@machine ~/$ su
Enter password:
r...@machine ~/$ ./aptupgscript.sh
Hello
Update done by root
r...@machine ~/$
(Sorry for possible wrong details, I typed it from mind :D)
Thanks,
aL.
--
Alois Mahdal using Opera's revolutionary e-mail client:
http://www.opera.com/mail/
--
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/op.vjqxuati53t...@aloism.cz.avg.com