Friday 7 October 2016

Ugly!

A dirty one liner as a small reminder for myself. Oh well, it did help my client to get those images out of this rotten old CMS quickly. And it wasn't as dirty as what people in #bash suggested. Dirty? Not dirty at all!

find ./ -iname "*image_large" -print0 | xargs -0 bash -c 'for image; do mv "$image" "$(dirname "$(dirname "$image")")"/$RANDOM.jpg; done' bash

3 comments:

Paul Cobbaut said...

Why is there a 'bash' at the end ?

Mark Van den Borre said...

Paul, https://en.wikipedia.org/wiki/Xargs#Shell_trick .

Unknown said...

Betsoft Casinos 2021: What makes them unique?
The main difference with other online air jordan 18 retro red suede online site casinos is air jordan 18 retro men red free shipping the free spins bonuses top air jordan 18 retro yellow that you 식보 can get with no deposit or find air jordan 18 retro toro mens sneakers risk. The main thing about the Betsoft