On Tue, Jan 24, 2012 at 20:36, Christian Vest Hansen
<[email protected]>wrote:

>
>
> On Tue, Jan 24, 2012 at 20:17, Jonathan Reed <[email protected]> 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
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to