fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] /usr/bin/wall through fab


From: Nicolas Maupu
Subject: Re: [Fab-user] /usr/bin/wall through fab
Date: Wed, 25 Jan 2012 12:31:32 +0100


On Tue, Jan 24, 2012 at 20:36, Christian Vest Hansen <address@hidden> wrote:


On Tue, Jan 24, 2012 at 20:17, Jonathan Reed <address@hidden> wrote:
im trying to use wall in my fab file. 
  run('wall')
  run('please logout before 3pm today')
  run('')  # Send EOF - Ctrl-V + Crtl-D

Is it that each run command is spawning a new session and the message is unaware of the previous command?

Correct. Fabric does not open a normal shell session, but sends isolated commands to be executed by a shell program on the remote hosts.

The `shell` env variable defines part of how commands are executed by the remote hosts: http://docs.fabfile.org/en/1.3.3/usage/env.html#shell
 
If so 
  run('wall; a test; ^D')
doesnt seem to work either.

Right, we are not directly interacting with a bash prompt here.
 

I could create a wall file, transfer it then run it but if the above worked it would be much simpler. 

You can also pipe from `echo`:

    run("echo 'a test' | wall")
 

Indeed, it's not a fab issue, but a shell issue. That's why command such as expect exists :
http://linux.die.net/man/1/expect

It that particular case, it's just standard unix command issue. Man wall says : "Wall displays the contents of file or, by default, its standard input", that's it.


--
Nicolas Maupu - SS2J - Excilys
Tél :+33 (0) 1 41 24 43 27


reply via email to

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