I am trying to write a script that takes a parameter from the cli and uses that number as a top limit in a range for creating a number of files.
num_files=$1
time parallel -N 10 'cat source.txt | tee copy{1}.txt copy{2}.txt copy{3}.txt copy{4}.txt copy{5}.txt copy{6}.txt copy{7}.txt copy{8}.txt copy{9}.txt copy{10}.txt' ::: {1..$numfiles}
I've tried every type of quoting I can think of but, oddly, the only output I get is a single file named copy{1..200}.txt
(if I pass in 200). So the number I pass in is getting picked up correctly, its just not working as I'd expect.
Is this possible?