help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SU commands from Emacs


From: Tim X
Subject: Re: SU commands from Emacs
Date: Fri, 24 Aug 2007 17:59:18 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> jadamson@partners.org (Joel J. Adamson) writes:
>
>> Sometimes I want to do a command that requires root privileges.
>
> Yes, lately I stumbled over a find-grep in /etc.  How could this be
> done with root privileges?
>

I use either sudo or su within a shell or term buffer to run commands as
root. 

I can't think of any straight-forward way to run elisp/emacs commands with
the privileges of another user - there just isn't a mechanism to do
this. The closest I could think of would be using some sort of
emacsclient/emacserver setup, but this would require having another emacs
running as root, which doesn't seem practicle to me. 

I have seen something in the most recent emacs docs that indicate tramp may
be able to execute processes on remote servers. If this is the case, it
should be possible, in conjunction with sudo/su as a connection method to
execute commands as root via tramp.

If you positively, must, have to run emacs commands as another user, I
guess you could call emacs in 'batch' mode, with a function call on the
command line - it may be possible to have the output sent back into a
buffer in the local emacs (i.e. like output from a shell command), but this
is going to be very slow and use a lot of resources (memory/cpu etc)

If the reason you want to use emacs to do processing as another user is
because you like to write stuff in lisp, then maybe something like lush
(Lisp User Shell), rep (lisp/scheme interpreter) scsh (scheme shell) or
even one of the mainstream CL implementations, like clisp, cmucl or sbcl
will give you what you want.

HTH

Tim


reply via email to

[Prev in Thread] Current Thread [Next in Thread]