I want to run a program requiring comma-separated arrays of files as follows:
program -input1 A.txt,B.txt,C.txt -input2 D.txt,E.txt,F.txt -out out.txt
My bash attempt:
I'm running command from a folder called ProgramFolder and this folder also contains file1.txt and file2.txt. file1.txt and file2.txt contain names of files for the program, such as:
File1: A.txt,B.txt,C.txt File2: D.txt,E.txt,F.txt
But "A.txt, B.txt,C.txt" and "D.txt, E.txt,F.txt" are in a different folder: source 1 and source2 as shown below.
## file sources source1= ~/Band/folder1/ source2= ~/Band/folder1/
I have tried running the program this way without success:
program -input $source1$(cat file1.txt) -input2 $source2$(cat file2.txt) -out out.txt
What is the best way to write a bash for running the program?