My first post on this forum,
I am trying to move all the txt files with a script from multiple directories to one directory, adding the parent directories of the files to the file names.
It's a little complicated to explain, but i hope the script i have so far explains what im trying to do better:
for i in `ls /home/monty/scripting`
mv -v /home/monty/scripting/$i/*.txt /home/monty/scripting/$i-*.txt
repeated for other file names an directories
the script works exactly how i want it to if i specify a filename, but my problem is maintaining the original file name whilst adding the parent directory to the file name.
Im hoping it's something really simple im missing?
Any help would be greatly appreciated