Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • thank you for taking you time to actually read my code to see what was going on. even thought I figured out a different way to do it with three lines of code within a loop as I added it to the rest of my script killfile="${pref}.${ext}" mv "$killfile" "${killfile//*/killme.k}" rm "killme.k" Commented Dec 7, 2013 at 20:35
  • No problem. If you don't need to rename the file first you could also solve it with find . -maxdepth 1 -type f -name '* *' -delete Commented Dec 7, 2013 at 21:04
  • I am using ffmpeg to converting mp3s to 128K giving them a new name with underscores to replace all the spaces and junk between the names in the file, then making directories according to there artist album metadata then putting them into said directories. I just had that problem of getting rid of the old file due to all the spaces and junk between the names of the artist and such. now it is working great and converting, placing new mp3's where they need to be and getting rid of the old file while I just sit here thinking of something else to write in bash script :D thanks! Commented Dec 7, 2013 at 21:28
  • 1
    You can get rid of the if statement if you use for FILE in $LOCATION/*.mp3 Commented Dec 18, 2013 at 18:29