Batch modifying a directory path
by PaulExordium from LinuxQuestions.org on (#6DFTQ)
In the example below I'd like to modify the directory path from .../ABC101/ABC101/... to .../ABC101/...
assuming that the upper level directory has no files and that the lower level directory has only files.
What would be a simple bash script to do that?
Code:~/TopDir/ABC101/ABC101/{files}
~/TopDir/ABC102/ABC102/{files}
...
~/TopDir/ABC199/ABC199/{files}Code:~/TopDir/ABC101/{files}
~/TopDir/ABC102/{files}
...
~/TopDir/ABC199/{files}
assuming that the upper level directory has no files and that the lower level directory has only files.
What would be a simple bash script to do that?
Code:~/TopDir/ABC101/ABC101/{files}
~/TopDir/ABC102/ABC102/{files}
...
~/TopDir/ABC199/ABC199/{files}Code:~/TopDir/ABC101/{files}
~/TopDir/ABC102/{files}
...
~/TopDir/ABC199/{files}