Created
May 12, 2013 11:20
-
-
Save tsu-nera/5563221 to your computer and use it in GitHub Desktop.
dotfilesのシンボリックをホームディレクトリに作成するシェルスクリプト
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/bash | |
| files=.* | |
| for file in ${files} | |
| do | |
| filepath="${PWD}/${file}" | |
| homefile="${HOME}/${file}" | |
| # . と .. .git は抜かす | |
| test $file == ".git" && continue | |
| test $file == "." && continue | |
| test $file == ".." && continue | |
| # .hogehogeが存在しなければ、シンボリックリンクを作成 | |
| if [ ! -e "${homefile}" ]; then | |
| echo "${file} not exis, make symbolic link to ${homefile}" | |
| ln -s "${filepath}" "${homefile}" | |
| else | |
| echo "${file} exist" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment