I have 2 or more jsonl files files and my objective is to merge the files and shuffle the lines of the output. The easy case is where I know the number of files and the file names and I can use the command below
cat file1.txt file2.txt file3.txt | shuf
However I don't know the number of files in advance. Is there a way so that a script merge.sh will work on variable number of arguments
merge.sh file1.txt file2.txt
merge.sh file1.txt file2.txt file3.txt file4.txt
Basically I don't know how to use $1 etc when the number of arguments is variable