How to combine the contents of a directory together in a separate script, and then pass this script as a parameter:
file1=$1 file2=$2 cp -R $file1/* $file2 echo $file2
Then you can use the script as follows:
./myscript "$(./merge dir1 dir2)" dir3 ...
source share