So I tried to use this script to get rid of a username in a bunch of files
#!/bin/bash ls | while read -r FILE do mv -v "$FILE" `echo $FILE | tr '[DarkDream]' '.' ` done Instead, all of the files that had the letters d, a, r, k, e and m got replace with a.
Is there a way to undo this?
echo "$FILE" | sed -e "s/DarkDream//"rename(packaged by many distributions) like so:rename 's/DarkDream//' *-v,mvwill print the original and new file name for every file that gets moved or renamed.D,a,r,k,e, andmgot renamed to the same name, with all of those letters replaced by periods (.); e.g.,cat,dog,meerkat, andDoggot renamed toc.t,dog,......t, and.og, respectively."? Did any files get clobbered, or is this just a rename problem?echoso you can verify it does exactly what you expect. Though that might require modification of the original command.