I process files found by ls as
ls /folder/ | parallel -j20 ./command {}
but I need to pass the job number as well. I tried
ls /folder/ | parallel -j20 ./command {1} {2} ::: {1..20}
ls /folder/ | parallel -j20 ./command {} {} ::: {1..20}
but it does not work. I also tried {#} for passing the job number.
lsin a script. Using aforloop orfindis always the better solution. – mashuptwice Feb 20 '22 at 11:19https://mywiki.wooledge.org/ParsingLs
– mashuptwice Feb 20 '22 at 11:30./command file1.txt 1and./command file2.txt 2etc.? – terdon Feb 20 '22 at 11:57./commandscript is irrelevant here. Consider it as a bash script withecho "$1 $2". Yes, the aim is to run/command file1.txt 1or/command 1 file1.txt. The order is not important as I can change the arguments inside the script. – Googlebot Feb 20 '22 at 12:55