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.
ls
in a script. Using afor
loop orfind
is always the better solution../command file1.txt 1
and./command file2.txt 2
etc.?