Advertisement
Guest User

Untitled

a guest
Sep 30th, 2017
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function rm
  2. {
  3. #on vire les options
  4. count=0
  5. for a in "$@"
  6. do
  7. echo $a|grep '^-' >/dev/null
  8. if [ "$?" != "0" ]
  9. then
  10. ((count+=1))
  11. fi
  12. done
  13. if (( count > 1 ))
  14. then
  15. echo -n "/bin/rm: $@ ?"
  16. read reply
  17. if [ "$reply" == "y" ]
  18. then
  19. /bin/rm -i "$@"
  20. fi
  21. else
  22. /bin/rm -i "$@"
  23. fi
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement