Skip to content

Instantly share code, notes, and snippets.

@PirosB3
Created November 15, 2012 11:10
Show Gist options
  • Save PirosB3/4078059 to your computer and use it in GitHub Desktop.
Save PirosB3/4078059 to your computer and use it in GitHub Desktop.
from fabric.context_managers import settings
from fabric.operations import local
def run_unix_command(command):
with settings(warn_only= True):
return local('ls', capture= True)
res = run_unix_command('ls -lah')
print res.return_code
print res.stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment