You are not logged in.
Hello, I use a script in thunar to move the content of a folder to the parent directory and remove the folder:
find %f -maxdepth 1 -type d \( ! -name . \) -exec bash -c "mv -v '{}'/* . && rmdir '{}'" \;
the problem is that when there are folders with characters that needs an excape like apostrophes, the action is not executed, how could I fix the script to handle also these cases?
Offline
You could reverse the quotes (single <-> double), but then you'll have a problem with double quotes in the directory name.
So better to do this:
find %f -mindepth 1 -maxdepth 1 -type d -exec bash -c 'mv -v "$1"/* . && rmdir "$1"' _ {} \;
I also used -mindepth instead of filtering on directory names.
aka Tamaranch: https://gitlab.xfce.org/Tamaranch
Offline