Last active
April 11, 2017 13:12
-
-
Save pauca/8cf6d75f56abfe14ceab438c39e0c6cc to your computer and use it in GitHub Desktop.
replace symbolik links in current directory by originals, and remove them
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
# loop over symbolik links in current directory | |
for f in `find . -maxdepth 1 -type l ` ; do | |
# get symlink destination | |
g=` readlink $f ` | |
# move original to directory | |
cp -f $g . | |
# clean | |
if [ $? == 0 ]; then | |
rm -f $g | |
rm -f $f | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment