Created
March 22, 2010 05:54
-
-
Save shiumachi/339829 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# | |
# there are many symbolic link which link to some file in OLDDIR in directory SYBDIR. | |
# one day, OLDDIR has suddenly been moved to NEWDIR, and all symbolic link | |
# in SYBDIR has been dead. | |
# you can't link from NEWDIR to OLDDIR in some reason. | |
# this script renewal all symbolic file target to new one. | |
# | |
OLDDIR=dir1 | |
NEWDIR=dir2 | |
SYBDIR=dir3 | |
cd ${SYBDIR} | |
for i in `find * -lname "*${OLDDIR}*"`;do | |
ln -fs ${NEWDIR}/${i} ${i} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment