Run shell script using fabric and piping script text to shell's stdin
Posted
by
Peter Lyons
on Stack Overflow
See other posts from Stack Overflow
or by Peter Lyons
Published on 2012-07-21T23:37:23Z
Indexed on
2013/10/21
21:54 UTC
Read the original article
Hit count: 302
Is there a way to execute a multi-line shell script by piping it to the remote shell's standard input in fabric? Or must I always write it to the remote filesystem, then run it, then delete it? I like sending to stdin as it avoids the temporary file. If there's no fabric API (and it seems like there is not based on my research), presumably I can just use the ssh
module directly. Basically I wish fabric.api.run
was not limited to a 1-line command that gets passed to the shell as a command line argument, but instead would take a full multi-line script and write it to the remote shell's standard input.
© Stack Overflow or respective owner