Created
July 3, 2019 07:38
-
-
Save mgallego/2e7f49e4a1a0b0f0577496110a8f9d2b to your computer and use it in GitHub Desktop.
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
for i in *; do | |
if [ ! \( -f "${i}" \) ] | |
then | |
FILENAME=$i | |
LINK=`readlink "$i"` | |
echo "Removing bad symlink $i" | |
rm "$i" | |
NEWLINK="${LINK/$1/$2}" | |
echo "Replacing $i from $LINK to $NEWLINK" | |
ln -s "$NEWLINK" "$FILENAME" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment