Created
February 15, 2013 06:33
-
-
Save qiukun/4958852 to your computer and use it in GitHub Desktop.
文件不要带 .
ln 过去的时候会加上 . 的
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 | |
cd `dirname $0` | |
F=`pwd |sed -e "s#$HOME/\?##"` | |
for P in * | |
do | |
# skip setup | |
if [ "$P" = "setup.sh" ]; then continue; fi | |
# ensure permissions | |
chmod -R o-rwx,g-rwx $P | |
# skip existing links | |
if [ -h "$HOME/.$P" ]; then continue; fi | |
# move existing dir out of the way | |
if [ -e "$HOME/.$P" ]; then | |
rm -rf "$HOME/.$P" | |
fi | |
# create link | |
echo -n "Link " | |
ln -v -s "$F/$P" "$HOME/.$P" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment