Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getrpms():
- queryall = []
- rpmqa = subprocess.Popen(['rpm', '-qa'], stdout=subprocess.PIPE,)
- grep = subprocess.Popen(['grep', 'stuff'], stdin=rpmqa.stdout, stdout=subprocess.PIPE,)
- sort = subprocess.Popen(['sort', '-r'], stdin=grep.stdout, stdout=subprocess.PIPE,)
- end_of_pipe = sort.stdout
- for line in end_of_pipe:
- queryall.append(line.strip())
- return queryall
- command = "rpm -q stuff --qf '%{NAME} %{VERSION} %{RELEASE}n'"
- args = shlex.split(command)
- p = subprocess.Popen(args)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement