]> git.eshelyaron.com Git - emacs.git/commitdiff
* tramp.texi (Remote processes): Improve eshell example with "su"
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 29 Nov 2009 20:40:51 +0000 (20:40 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 29 Nov 2009 20:40:51 +0000 (20:40 +0000)
and "sudo" commands.

doc/misc/ChangeLog
doc/misc/tramp.texi

index 7b0a82f5ce70d9dadba6094e93f5a1bdcbdb31d3..8fd689af94467780bceae6d287d90d2a52ae1acb 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-29  Michael Albinus  <michael.albinus@gmx.de>
+
+       * tramp.texi (Remote processes): Improve eshell example with "su"
+       and "sudo" commands.
+
 2009-11-28  Chong Yidong  <cyd@stupidchicken.com>
 
        * semantic.texi (Analyzer Internals): Rename from Analyzer.
index 2c48fe32c55ddcd962bfa1e90cd27f7db24ce91f..f0c0b6a39244aa143684c4733ba76d20da82ed2a 100644 (file)
@@ -2584,6 +2584,27 @@ uid=0(root) gid=0(root) groups=0(root)
 @b{@trampfn{sudo, root, host, /etc} $}
 @end example
 
+@ifset emacs
+Since @value{emacsname} 23.2, @code{eshell} has also an own
+implementation of the @code{su} and @code{sudo} commands.  Both
+commands change the default directory of the @file{*eshell*} buffer to
+the value related to the user the command has switched to.  This works
+even on remote hosts, adding silently a corresponding entry to the
+variable @code{tramp-default-proxies-alist} (@pxref{Multi-hops}):
+
+@example
+@b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET}
+@b{@trampfn{ssh, user, remotehost, /etc} $} find-file shadow
+File is not readable: @trampfn{ssh, user, remotehost, /etc/shadow}
+@b{@trampfn{ssh, user, remotehost, /etc} $} sudo find-file shadow
+#<buffer shadow>
+@b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET}
+@b{@trampfn{su, root, remotehost, /root} $} id @key{RET}
+uid=0(root) gid=0(root) groups=0(root)
+@b{@trampfn{su, root, remotehost, /root} $}
+@end example
+@end ifset
+
 
 @anchor{Running a debugger on a remote host}
 @subsection Running a debugger on a remote host