summaryrefslogtreecommitdiff
path: root/link.sh
blob: 86b22e4e41b45e2b6ccc526e453fc196fe4db142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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 name in $files; do
    mv ~/.$name ~/dotfiles_old/
    ln -s $dir/$name ~/.$name
done