Below scrip reads lines of commands to execute from a cmdAll.txt. Is there a way that I merge the command file into the script file itself. I remember I have seen such data blocks using <<EOF somewhere but I am not sure how to do it.
myScript.py file:
#!/usr/bin/python
i=1
import enms
s = enms.open()
with open('cmdAll.txt') as f:
for cmd in f:
r = s.terminal().execute(cmd)
filename = "output_%d.txt" % i
fp = open(filename, 'w')
for line in r.get_output():
print line
fp.write(line + "\n")
fp.close()
i+=1
f.close()
enms.close(s)
cmdAll.txt file:
cmget get * en.(enbid) -t
cmget get * gn.(gnbid) -t
cmget get * gnssinfo.(latitude,longitude) --table
cmget get * GpsSyncRef.(latitude,longitude) --table