comparison setup @ 74:54a82956bb11

[tcsh,setup] updated tcsh to new naming scheme.
author Edho Prima Arief <me@myconan.net>
date Sat, 04 Jun 2011 19:25:34 +0700
parents e6aa07cf62cc
children 7c01fc6f7460
comparison
equal deleted inserted replaced
73:d9aace34d144 74:54a82956bb11
1 #!/bin/sh 1 #!/bin/sh
2 2
3 install() { 3 install() {
4 uninstall 4 uninstall
5 #create symlinks 5 #create symlinks
6 linker "tcsh" ".tcsh_init" 6 linker "tcsh" ".ecos_tcsh"
7 linker "bash" ".ecos_bash" 7 linker "bash" ".ecos_bash"
8 linker "zsh" ".ecos_zsh" 8 linker "zsh" ".ecos_zsh"
9 linker "tmux" ".tmux.conf" 9 linker "tmux" ".tmux.conf"
10 linker "hg" ".hgrc" 10 linker "hg" ".hgrc"
11 linker "vim" ".vimrc" 11 linker "vim" ".vimrc"
13 #originally bin-ec. Renamed to .ecos.bin for sanity when listing home 13 #originally bin-ec. Renamed to .ecos.bin for sanity when listing home
14 #and replaced . with _ for more sanity 14 #and replaced . with _ for more sanity
15 linker "bin" ".ecos_bin" 15 linker "bin" ".ecos_bin"
16 16
17 #modify cshrc 17 #modify cshrc
18 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc" 18 echo '[ -r "${HOME}/.ecos_tcsh" ] && source "${HOME}/.ecos_tcsh" #ECCORE_TCSH' >> "${HOME}/.cshrc"
19 #modify bash_profile and bashrc 19 #modify bash_profile and bashrc
20 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bash_profile" 20 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bash_profile"
21 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bashrc" 21 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bashrc"
22 #modify zshrc 22 #modify zshrc
23 echo '[ -r "${HOME}/.ecos_zsh" ] && . "${HOME}/.ecos_zsh" #ECCORE_ZSH' >> "${HOME}/.zshrc" 23 echo '[ -r "${HOME}/.ecos_zsh" ] && . "${HOME}/.ecos_zsh" #ECCORE_ZSH' >> "${HOME}/.zshrc"
34 mv .cleancshrc "${HOME}/.cshrc" 34 mv .cleancshrc "${HOME}/.cshrc"
35 fi 35 fi
36 } 36 }
37 37
38 uninstall() { 38 uninstall() {
39 for i in .tcsh_init .tmux.conf .hgrc .vimrc .inputrc bin-ec .ecos.bin; do 39 for i in .ecos_tcsh .tmux.conf .hgrc .vimrc .inputrc bin-ec .ecos.bin .ecos_bin .ecos_bash .ecos_zsh; do
40 if [ -f "${HOME}/${i}" ]; then 40 if [ -f "${HOME}/${i}" ]; then
41 echo "Removing file: ~/${i}" 41 echo "Removing file: ~/${i}"
42 rm -f "${HOME}/${i}" 42 rm -f "${HOME}/${i}"
43 fi 43 fi
44 done 44 done
45 uninstall_tcsh 45 uninstall_tcsh
46 } 46 }
47 47
48 update() { 48 update() {
49 if [ -f "${HOME}/.tcsh_exec" ]; then 49 if [ -f "${HOME}/.tcsh_exec" ]; then
50 mv -f "${HOME}/.tcsh_exec" "${HOME}/.tcsh_init.after" 50 mv -f "${HOME}/.tcsh_exec" "${HOME}/.ecos_tcsh.after"
51 echo "Moved: ${HOME}/.tcsh_exec => ${HOME}/.tcsh_init.after" 51 echo "Moved: ${HOME}/.tcsh_exec => ${HOME}/.ecos_tcsh.after"
52 fi 52 fi
53 } 53 }
54 54
55 help() { 55 help() {
56 cat <<EOF 56 cat <<EOF