I have many folders that I have ended up with too many
empties in the folder names and I need to remove all the
empty and leave the folders with
Of course my logic is flawed here as I am not sure how to get the
new file name. I can only get what is matching from regex.
#!/bin/sh for I in `cat filelist`; do # for renaming, use mv NEWNAME = `$I.empty` echo $NEWNAME done
The goal is to replace folders that have
$ empty.empty then be
$.empty. The folders that do not contain
empty.empty should be left alone.