I'm trying to do a for loop with popen which uses the variable .How to use the "line" variable inside the for loop which uses os.open for linux commands.
os.popen("yum history | awk '{print $1}' | grep -v 'Loaded\|history\|ID\|-' > ids.txt" ).read()
myfile = open("ids.txt", "r")
for line in myfile:
first=os.popen("yum history info + line + | grep -i Command | awk '{print $4,$5}'").read().strip()
# first="yum history info +line | grep -i Command "
print(line)
print(first)
myfile.close()