tramp-devel
[Top][All Lists]
Advanced

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

Re: answer to shell script question after login


From: Canellas
Subject: Re: answer to shell script question after login
Date: Mon, 12 Dec 2011 09:59:13 -0200

Michael,

I appreciate a lot your help, but it still does not work. I am confident the regex is correct, so I think it is something else.

Anyway, this is my '.emacs', regarding 'tramp':

;; ============================== tramp ============================================
(require 'tramp)

(setq tramp-verbose 10)

(defconst dpa-prompt "19- MDBACT.+")

(defun dpa-action (proc vec) "Resposta ao script q roda na dpa."
  (save-window-excursion
    (with-current-buffer (tramp-get-connection-buffer vec)
      (tramp-message vec 6 "\n%s" (buffer-string))
      (tramp-send-string vec "3"))))

(add-to-list 'tramp-actions-before-shell
             '(dpa-prompt dpa-action))


And attached is (a part of) the tramp debug.


Thanks!

    Rodrigo Canellas

    -----------
    Programador C++
    Fotógrafo amador
 





2011/12/9 Canellas <address@hidden>

Thanks a lot!
I'll give it a try first thing next Monday.

Em 09/12/2011 19:13, "Michael Albinus" <address@hidden> escreveu:

Canellas <address@hidden> writes:

> Michael,

Hi Rodrigo,

sorry for the delay, I have been occupied otherwise.

> 14:45:41.202897 tramp-process-one-action (5) # Looking for regexp "\(\(Digite o numero do ambiente e pressione enter\)\s-*\)\'" from remote shell

You have defined the regexp

 "\\(Digite o numero do ambiente e pressione enter:\\)\\s-*"

Tramp expects this to be at the end of the buffer (see the docstring
of `tramp-actions-before-shell'), and extends this to

 "\\(\\(Digite o numero do ambiente e pressione enter\\)\\s-*\\)\\'".

But in fact, there are non-printable characters as you have also said
the other message:

 Digite o numero do ambiente e pressione enter^M

You could expand the regexp for the trailing ^M. However, you want to
send the selection "3" only when the whole login message is visible. So
I recommend that you compose a regexp matching the last line of the
login message, simply like this:

 "19- MDBACT.+"

Best regards, Michael.

Attachment: tramp_debug.txt
Description: Text document


reply via email to

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