summaryrefslogtreecommitdiff
path: root/link.sh
blob: 6d516e3d687353031979bed887e3589297356940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# create dotfiles_old in homedir
olddir=~/dotfiles_old
mkdir -p $olddir

# change to the dotfiles directory
dir=~/dotfiles/dotfiles
cd $dir

# move current files and link contained files
files=$(ls $dir)
for f in $files; do
    name=${f//+//}
    echo $name
    mv ~/.$name ~/dotfiles_old/
    ln -s $dir/$f ~/.$name
done