Created
August 8, 2024 19:49
-
-
Save edt11x/36e5a9f63244ffe1fb77c7dd4a265697 to your computer and use it in GitHub Desktop.
Find Bad Symbolic Links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| for i in `find . -print` | |
| do | |
| if [ -h "$i" ] && [ ! -r "$i" ] | |
| then | |
| echo "Bad symbolic link $i" | |
| /bin/rm -i "$i" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment