]> git.friedersdorff.com Git - max/dotfiles.git/blob - makelinks.sh
Load .bashrc from .bash_profile for login shells.
[max/dotfiles.git] / makelinks.sh
1 #!/bin/bash
2 ############################
3 # .make.sh
4 # Create symlinks from the home directory to dotfiles in ~/etc/dotfiles
5 ############################
6
7 ########## Variables
8
9 dir=~/etc/dotfiles                    
10 olddir=~/etc/dotfiles.bak             
11 files="vimrc bashrc bash_profile Xresources gitconfig zprofile zshenv zshrc xinitrc"
12
13 ##########
14
15 # create dotfiles_old in homedir
16 mkdir -p $olddir
17
18 # change to the dotfiles directory
19 cd $dir
20
21 # move any existing dotfiles in homedir to dotfiles_old directory, 
22 #then create symlinks from the homedir to any files in the 
23 #~/dotfiles directory specified in $files
24 for file in $files; do
25     mv ~/.$file $olddir/
26     ln -s $dir/$file ~/.$file
27 done