Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function dl () {
  2. local path
  3. for path in "$@"; do
  4. # ignore any arguments
  5. if [[ "$path" = -* ]]; then :
  6. else
  7. local dst=${path##*/}
  8. # append the time if necessary
  9. while [ -e ~/.Trash/"$dst" ]; do
  10. dst="$dst"_$(date +%H-%M-%S)
  11. done
  12. mv "$path" ~/.Trash/"$dst"
  13. fi
  14. done
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement