unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Scripting actions over tramp
@ 2010-10-05 12:13 Gary
  2010-10-05 14:30 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Gary @ 2010-10-05 12:13 UTC (permalink / raw)
  To: help-gnu-emacs

Maybe I should just try this, and am "worrying" over nothing, but I am
absolutely cream-crackered after being woken twice by alarms last night,
so my brain isn't working.

Is there a way to perform automated actions via tramp (or some other
method in emacs) on remote hosts?

Something like:

(tramp-ssh-connect some.host)
(tramp-exec "ls -la") ;; list directory contents on some.host
(tramp-disconnect some.host)

or something. I'm not bothered about having to type in username/password
combinations at this stage in order to login, more about executing some
commands on the remote host.

I'm also not interested in editing remote files in this scenario, what I
want is to be able to have the mode I am writing be able to interact
with the host to which I have just uploaded a script, say (that's not it
exactly but it's the easiest way to describe it).

-- 
Gary        Please do NOT send me 'courtesy' replies off-list.
GNU Emacs 23.2.1
emacsclient 23.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Scripting actions over tramp
  2010-10-05 12:13 Scripting actions over tramp Gary
@ 2010-10-05 14:30 ` Michael Albinus
  2010-10-06 11:47   ` Gary
       [not found]   ` <mailman.1.1286365681.29500.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Albinus @ 2010-10-05 14:30 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> Is there a way to perform automated actions via tramp (or some other
> method in emacs) on remote hosts?
>
> Something like:
>
> (tramp-ssh-connect some.host)
> (tramp-exec "ls -la") ;; list directory contents on some.host
> (tramp-disconnect some.host)

(let ((default-directory "/ssh:user@some.host:"))
  (shell-command "ls -al"))

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Scripting actions over tramp
  2010-10-05 14:30 ` Michael Albinus
@ 2010-10-06 11:47   ` Gary
       [not found]   ` <mailman.1.1286365681.29500.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Gary @ 2010-10-06 11:47 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Albinus wrote:
> Gary writes:
>
>> Is there a way to perform automated actions via tramp (or some other
>> method in emacs) on remote hosts?
>>
>> Something like:
>>
>> (tramp-ssh-connect some.host)
>> (tramp-exec "ls -la") ;; list directory contents on some.host
>> (tramp-disconnect some.host)
>
> (let ((default-directory "/ssh:user@some.host:"))
>   (shell-command "ls -al"))

Thanks Michael. No wonder I couldn't find it - not only
,----
| shell-command is an interactive compiled Lisp function in `simple.el'.
| ...
| Not documented.
  ^^^^^^^^^^^^^^ (bah!)
`----
but I also wasn't aware of the ability to use it like that, even though
I pretty regularly use it via M-!.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Scripting actions over tramp
       [not found]   ` <mailman.1.1286365681.29500.help-gnu-emacs@gnu.org>
@ 2010-10-07  8:17     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2010-10-07  8:17 UTC (permalink / raw)
  To: help-gnu-emacs

> Thanks Michael. No wonder I couldn't find it - not only
> ,----
> | shell-command is an interactive compiled Lisp function in `simple.el'.
> | ...
> | Not documented.
>   ^^^^^^^^^^^^^^ (bah!)

There seems to be a problem in your version of Emacs.  Please report it
as a bug.


        Stefan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-07  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 12:13 Scripting actions over tramp Gary
2010-10-05 14:30 ` Michael Albinus
2010-10-06 11:47   ` Gary
     [not found]   ` <mailman.1.1286365681.29500.help-gnu-emacs@gnu.org>
2010-10-07  8:17     ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).