Iteratively pass one file from a collection of files as command line parameters in shell script
<p>I have <em>x</em> files: <em>A, B, C...</em> What I need to do is pass each of these files as the first command line argument to a python file and pass the others as the second command line argument until all files have been passed as $1 once. For example, on the first iteration <em>A</em> is $1 and <em>B,C...</em> is $2. On the second iteration, <em>B</em> is $1 and <em>A,C...</em> is $2. I've read about the <em>shift</em> command in shell but am not very sure if it will work in my case (I'm also relatively new to shell scripting). Also, is there a limit to the number of command line arguments I can pass to my python script? I would also like to create a variable to hold the list of file names before iterating through my files. Thank you!</p>