Created
April 17, 2013 09:56
-
-
Save informationsea/5403136 to your computer and use it in GitHub Desktop.
Install dot files from repository. This script create symbolic links from all files starts with "dot_" in current directory to a home directory.
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/bash | |
DOTFILES=`find "$PWD" -mindepth 1 -maxdepth 1 -name "dot_*"` | |
TIME=`LANG=C date` | |
pushd "$HOME" | |
for i in $DOTFILES;do | |
NEWNAME=`basename "$i" | sed -e "s|^dot_|$HOME/.|"` | |
if [ -L "$NEWNAME" ];then | |
echo "$NEWNAME is already symbolic link" | |
else | |
echo "$i" "-->" "$NEWNAME" | |
if [ -e "$NEWNAME" ];then | |
mv "$NEWNAME" "${NEWNAME}-${TIME}" | |
fi | |
ln -s "$i" "$NEWNAME" | |
fi | |
done | |
mkdir -p ~/Documents/Editor/Backups | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment