oberblastmeister / trashy

a cli system trash manager, alternative to rm and trash-cli
Apache License 2.0
371 stars 12 forks source link

[fzf script] wrong when File name or directory contains space #118

Open Ziqi-Yang opened 6 months ago

Ziqi-Yang commented 6 months ago

Example path:

/home/xxx/xxx xxx/aaa bbb ccc.zip

Original scirpt(failed):

trashy list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trashy restore --match=exact --force

My modified Version(works):

trash list --rev -d . | fzf --multi | awk '{$1=$1;print}' | grep -o '/home.*' | xargs -r -d '\n' trash restore --match=exact

(I don't know whether root user have trash. It may not work for root user)