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: David Hansen
Subject: Re: SU commands from Emacs
Date: Fri, 17 Aug 2007 21:04:42 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

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/")))

David





reply via email to

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