diff --git a/.bashrc b/.bashrc index 1368e46..cfd0a03 100644 --- a/.bashrc +++ b/.bashrc @@ -139,9 +139,49 @@ gitpush() { } swp() { - find ${1-~} -name *.swp -exec rm -i {} \; + cpath=. + interactive='-i' + while [ -n "$1" ]; do # while loop starts + case "$1" in + -noi) interactive='';; + -d) if [[ -d "$2" ]]; then + cpath="$2" + else + echo Folder "$2" not exists + fi + shift;; + *) echo "Option $1 not recognized" ;; + esac + shift #shift params + done + + find $cpath -name "*."swp -exec rm "$interactive" {} \; } +purgefext() { + cpath=. + interactive='-i' + ext='' + while [ -n "$1" ]; do # while loop starts + case "$1" in + -noi) interactive='';; + -d) if [[ -d "$2" ]]; then + cpath="$2" + else + echo Folder "$2" not exists + fi + shift;; + -e) ext="$2" + shift;; + *) echo "Option $1 not recognized" ;; + esac + shift #shift params + done + + find $cpath -name "*."$ext -exec rm $interactive {} \; +} + + man() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \