- #!/usr/bin/python3
- import sys
- import os.path
- def easyOptionsArgs(lookingFor,theArgs):
- n = len(theArgs)
- theValue=""
- for i in range(1, n):
- if (sys.argv[i].startswith(lookingFor)):
- theValue=sys.argv[i].split("=")
- return theValue[1:][0]
- return theValue
- #inFile = easyOptionsArgs("-f",sys.argv)
- outFile = easyOptionsArgs("-o",sys.argv)
- commandEh = easyOptionsArgs("-c",sys.argv)
- #print("inFile",inFile)
- print("outFile",outFile)
- print("commandEh",commandEh)
- for line in sys.stdin:
- line = line.strip()
- print("#" + line )
- newFile = line + outFile
- if os.path.isfile(newFile) is False:
- newCommand=commandEh.replace("%1",line)
- newCommand=newCommand.replace("%2",newFile)
- print(newCommand)
IfNotFoundDo
Posted by Anonymous on Fri 30th Apr 2021 01:19
raw | new post
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.