from gppylib.commands.base import Command cmd = Command('ls', '-l') stdout, stderr, rc = cmd.run() print(stdout)
from gppylib.commands.base import Command cmd1 = Command('grep', 'error', stdin='file1.log') cmd2 = Command('tail', '-n 10', stdin=cmd1.stdout) stdout, stderr, rc = cmd2.run() print(stdout)In these examples, we imported the Command function from the gppylib.commands.base package library. We then created a new Command object with the desired shell command and its arguments. We then called the Command run function to execute the command and get the outputs.