1246c3e08bfb7d999bac2ae3e9933084cffbc4eb
- Author
- Andrew Janke <janke@pobox.com>
- Committer
- Andrew Janke <janke@pobox.com>
- Date
Message
install.sh: Replace nonstandard "sed -i" with sed + mv commands. Makes portable to systems whose sed lacks "-i", like OpenBSD.
Diff
1diff --git a/tools/install.sh b/tools/install.sh
2index bd4c5574988646ed5ebb55704e5046665b9c16bd..496199363e0c45ea36f70bb51272f1aee3fc5237 100755
3--- a/tools/install.sh
4+++ b/tools/install.sh
5@@ -23,14 +23,16 @@ fi
6
7 echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
8 cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
9-sed -i -e "/^export ZSH=/ c\\
10+sed "/^export ZSH=/ c\\
11 export ZSH=$ZSH
12-" ~/.zshrc
13+" ~/.zshrc > ~/.zshrc-omztemp
14+mv -f ~/.zshrc-omztemp ~/.zshrc
15
16 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
17-sed -i -e "/export PATH=/ c\\
18+sed "/export PATH=/ c\\
19 export PATH=\"$PATH\"
20-" ~/.zshrc
21+" ~/.zshrc > ~/.zshrc-omztemp
22+mv -f ~/.zshrc-omztemp ~/.zshrc
23
24 if [ "$SHELL" != "$(which zsh)" ]; then
25 echo "\033[0;34mTime to change your default shell to zsh!\033[0m"