-
-
Save theory/1368591 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
#!/bin/sh | |
pwd=`pwd` | |
for i in dot.* | |
do | |
if [ -d "$i" ] | |
then | |
for j in `find $i -type file` | |
do | |
s=`echo $j | sed -e s/^dot//` | |
if [ -e "$HOME/$s" ] | |
then | |
mv $HOME/$s $HOME/$s.bak | |
else | |
b=`dirname $j` | |
mkdir -p $b | |
fi | |
ln -s $pwd/$j $HOME/$s | |
done | |
else | |
s=`echo $i | sed -e s/^dot//` | |
if [ -e "$HOME/$s" ] | |
then | |
mv $HOME/$s $HOME/$s.bak | |
fi | |
ln -s $pwd/$i $HOME/$s | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, no problem, @noodles-v6. If you have files in the current directory starting with
dot.
, they will be copied to your home directory without thedot.
. For example,dot.emacs
would become~/.emacs
.