I know this bash code for execute an operation for all files in one directory:
for files in dir/*.ext; do
cmd option "${files%.*}.ext" out "${files%.*}.newext"; done
But now I have to execute an operation for all files in one directory with all files in another directory with the same filename but different extension. For example
directory 1 -> file1.txt, file2.txt, file3.txt
directory 2 -> file1.csv, file2.csv, file3.csv
cmd file1.txt file1.csv > file1.newext
cmd file2.txt file2.csv > file2.newext
I must not to compare two files, but the script that I have to execute needs two file to produce another one (in particular I have to execute
bwa samsa path_to_ref/ref file1.txt file1.csv > file1.newext
)
Could you help me?
Thank you for your answers!