I can't find a similar question on SO.
How can I properly pass a bash script as an argument to another bash script.
For example, let's say I have two scripts that can each accept a number of parameters, I want to pass one script as the argument of the other. Something like:
./script1 (./script2 file1 file2) file3
In the above example, script2 merges file1 and file2 together, and echos a new file, however that is irrelevant to the question. I just want to know how I can pass script2 as a parameter, i.e. the proper syntax.
If this is not possible, any hint as to how I may circumvent the issue would be appropriate.
script2, once you have "passed" it toscript1?script1I was using just iterates over all the contents of the parameters. But, I'm just interested in figuring out how I can pass the script as a parameter, because its not working for me.script2passing the file namesfile1andfile2at some point. Would it be sufficient to pass the result of this action?