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.

6
  • This should help: tldp.org/LDP/abs/html/string-manipulation.html Commented Sep 18, 2020 at 14:02
  • Thanks @terdon, I am a bit of a n00b, but your link was helpful. I think I need something like ${f/%.jpg/-60.jpg} but I'm not sure how I can fit that into my script. Where would it go? That code cannot replace the $f at the end my script cause it will then look for bob-dylan-60.jpg and that won't exist. Commented Sep 18, 2020 at 14:56
  • No, you would add an mv command afterwards. Sorry, I don't have time to post a full answer now (hence the link) but I'll try to later. Commented Sep 18, 2020 at 15:14
  • Oh I see, so the rename won't be part of the mogrify command, it'll be a separate command! Ok I'll try that. Commented Sep 18, 2020 at 15:22
  • 1
    I think that mogrify can take an output name as an argument, you could use it there too. Commented Sep 18, 2020 at 15:23