Executing commands over SSH doesn't keep a real shell around (this is true for other SSH automation too - think of it as a series of "ssh <hostname> <command>" calls in your shell).
So - typically you have to fake it by generating prefixed commands. E.g. Fabric's cd() helper just updates run() calls within its block so they all actually start with "cd <path> && ...". You can do this with arbitrary commands by using the prefix() helper - http://docs.fabfile.org/en/1.10/api/core/context_managers.html#fabric.context_managers.prefix Best, Jeff On Fri, Feb 13, 2015 at 5:36 AM, Jörg Schneider <[email protected]> wrote: > For managing some network devices I have to send something like „configure“ > command at first before I can do the real magic with fab. > Does fabric „keep“ the remote context (or „path" if you see it as „cd > something“)? > > J. Schneider > > > _______________________________________________ > Fab-user mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/fab-user -- Jeff Forcier Unix sysadmin; Python/Ruby engineer http://bitprophet.org _______________________________________________ Fab-user mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/fab-user
