From: Stefaan C. <ste...@ax...> - 2007-03-24 19:34:15
|
On Saturday 24 March 2007, Ken Irving wrote: > On Thu, Mar 22, 2007 at 03:26:49PM +0100, Stefaan Coene wrote: > > Hi, > > > > I want to automate some remote commands and to do so, I want to match the > > prompt of the remote server. The problem is that there is a tilde (~) in > > the > > prompt. No mather what I tried, I can not match the prompt. > > Changing the prompt so there is no tilde in it, is no option. > > > > Any idea ? > > I don't think tilde should have any special meaning in regular > expressions, but it is sometimes used as an escape character in > transport protocols, e.g., ssh or the cu/tip program. If that's > where it's hanging up, it may be possible to specify a different > escape character, so tilde would work like an ordinary character. > Or, it's usually possible to "escape" an escape character, e.g,. > by using two of them instead of one. Just a guess. > > Ken I don't know that this messsage will reach the list. I tried to subscribe with different email address. Sometimes I got a confirmation email, sometimes I gog http errrors and so on. So I hope I didn't spammed the list too much. Anyway, when I set the prompt so there was no tilde in, expect is working like expected. The tilde was the problem. Was. I found a simple solution. When I spawn the remote session, I let it timeout and set the prompt to a random string. So, I can match the random string and don't have to match the ~ Stef |