I have text file contain the following commandscommand1 file1_input; command2 file1_outputcommand1 file2_input; command2 file2_outputcommand1 file3_input; command2 file3_outputcommand1 file4_input; command2 file4_outputcommand1 file5_input; command2 file5_outputcommand1 file6_input; command2 file6_outputcommand1 file7_input; command2 file7_output................................................................................I named this file commands then I gave it permission using chmod a+x  I want command 1 to be run, then command 2. Also I want this to be applied on all the files (file1, file2, .... etc) at once. How can I modify the content of this file to do that?I tried the following but it didn't work:(command1 file1_input; command2 file1_outputcommand1 file2_input; command2 file2_outputcommand1 file3_input; command2 file3_outputcommand1 file4_input; command2 file4_outputcommand1 file5_input; command2 file5_outputcommand1 file6_input; command2 file6_outputcommand1 file7_input; command2 file7_output................................................................................)&
Running commands at once
shell script;scripting;parallelism
Make the lines as such:(command1 file1_input; command2 file1_output) &(command1 file2_input; command2 file2_output) &...And each line will execute its two commands in sequence, but each line will be forked off as parallel background jobs.If you want the second command to execute only if the first command completed successfully, then change the semicolon to &&:(command1 file1_input && command2 file1_output) &(command1 file2_input && command2 file2_output) &...