I have been working on a script mixture of bash and python script. The bash script can receive unknown count input arguments. For example :
tinify.sh test1.jpg test2.jpg test3.jpg .....
After the bash receives all, it pass these arguments to tinify.py. Now I have come out two ways to do that.
Loop in
bashand callpython tinify.py testx.jpgIn another word,
python tinify test1.jpgthenpython tinify test2.jpg, finalypython tinify test3.jpgPass all arguments to
tinify.pythen loop inpython
But there is a problem, I want to filter same parameter for example if user input tinify.sh test1.jpg test1.jpg test1.jpg , I only want tinify.sh test1.jpg.So I think it's easier to do in second way because python may be convenient.
How can I do to pass all arguments to python script? Thanks in advance!
"$@", not bare$@, or you're splitting on spaces, expanding literal globs in names, and otherwise not passing the input exactly as it was received.