#!/bin/bash# create dotfiles_old in homedirolddir=~/dotfiles_old
mkdir -p $olddir# change to the dotfiles directorydir=~/dotfiles/dotfiles
cd$dir# move current files and link contained filesfiles=$(ls $dir)for name in $files;do
mv ~/.$name ~/dotfiles_old/
ln -s $dir/$name ~/.$namedone