HI, I am completely new to Bash and StackOverflow.
I need to transfer a set of files (all of them are contained in one folder) to the target folder, where files with the same name may already exist.
If a specific file exists, I need to rename the file before moving it, adding, for example, an incremental integer to the file name.
Extensions must be preserved (in other words, the added incremental integer must be before ). File names may contain dots in the middle.
I initially thought about comparing two folders to have a list of existing files (I did this with "comm"), but then I got a little stuck. I think I'm just trying to do something in the most difficult way.
Any hint of this in bash style? This is normal if done in a script other than a Bash script.
Katie source
share