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: Joel J. Adamson
Subject: Re: SU commands from Emacs
Date: Fri, 17 Aug 2007 16:28:51 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

David Hansen <address@hidden> writes:

> On Fri, 17 Aug 2007 13:38:59 -0400 Joel J. Adamson wrote:
>
>> The one remaining problem is executing shell commands that need root
>> permission.  I can use Dired and edit files with "/su::" tramp-mode,
>> however sometimes I just need to execute a command.  I have sudo
>> installed on Slackware Linux 12.0, but the password prompt does not
>> come up properly.
>
> I use
>
> (defun root-shell (&optional arg)
>   (interactive "P")
>   (let ((explicit-shell-file-name "sudo"))
>     (shell (if arg
>                (generate-new-buffer-name "*root shell*")
>              "*root shell*"))
>     ;; change this to your roots home directory
>     (setq default-directory "/root/")))

Thanks David, that's slightly more convenient than entering a terminal
emulator *and then* entering "su..." --- but I mean something
different.  I'd like to run root commands straight from an editor
window, for example Dired.  Deleting files is fine, I just do dired
with "/su::<directory>" and then run the regular dired commands.
Sometimes I want to do a command that requires root privileges.

Joel


-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109


reply via email to

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