Braber01

Braber01

Oct 2nd, 2010
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #!/bin/bash
  2. #del.sh
  3.  
  4. if [[ $# -eq 0 ]]; then
  5.     echo "Usage: del [filename | dirname]" >&2
  6. elif [[ $# -eq 1 ]]; then
  7.     if [[ -d $1 ]]; then
  8.         rm -ri $1
  9.     elif [[ -f $1 ]];then
  10.         rm -i $1
  11.     elif [[ !-e $1 ]];then
  12.         echo "File or Directory does not Exisit" >&2
  13.     fi
  14. fi
Add Comment
Please, Sign In to add comment