Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Made by:
- # $0 DESTDIR LINK_TARGET
- case ${2?} in [^/]*) set -- "$1" "$PWD/$2" ;; esac
- case $1 in [^/]*) set -- "$PWD/$1" "$2" ;; esac
- /usr/bin/find -L "$1" -samefile "$2" -not -wholename "$2" -print0 |
- /usr/bin/xargs -0 /bin/rm
- exit $?
- test ! -L "${2?}" && find "$1" -type l -exec test "$2" -ef {} \; -delete
- ### And adopted version ###
- #!/bin/sh
- # Made by: xx
- [ -z "$2" ] && DIALOG=true || DIALOG=false
- while $DIALOG
- do
- echo -n "Input dir: " ;read dir
- echo -n "Input file: " ;read file
- set -- "$dir" "$file"
- echo -n "Dir=[$1] File=[$2]. Run [no]? " ;read ans
- case $ans in [yY][eE][sS]) DIALOG=false ;;esac
- done
- [ ! -L "$2" ] && find "$1" -type l -exec test "$2" -ef {} \; -delete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement