Copy several files with the same name in different directories in a destination directory with unique names
I have multiple subdirectories inside a directory and each of them contains a file with the same name (but different contents). I wish to copy all these files of the same name into a destination directory such that they each have a unique name. The unique names can be differentiated with timestamp, or the directory name can be appended to each file name.
Example:
if diff had an output then break and set a variable
I have a problem doing the following process in bash script:
How to concat a string after a variable (exported) in shell script
I have two shell scripts.