Browse files

Remove dependence on bash in install.sh

Replace bashisms with syntax supported by all posix-compliant shells.
The echo command does not support -e in many simplified shells
(including dash) so printf is favored.  The [[ ... ]] notation is also
not accepted by all posix shells so [ ... ] notation is used instead.
  • Loading branch information...
1 parent 51d3ad0 commit 0d7ee4866be581902e8c1a41f6eb4bd41541e94c @treyhunner treyhunner committed Oct 20, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 install.sh
View
10 install.sh
@@ -1,12 +1,12 @@
-#!/bin/bash
+#!/bin/sh
# This loads SCM Breeze into the shell session.
-exec_string='[[ -s "$HOME/.scm_breeze/scm_breeze.sh" ]] && . "$HOME/.scm_breeze/scm_breeze.sh"'
+exec_string='[ -s "$HOME/.scm_breeze/scm_breeze.sh" ] && . "$HOME/.scm_breeze/scm_breeze.sh"'
# Add line to bashrc and zshrc if not already present.
for rc in bashrc zshrc; do
- if [[ -s "$HOME/.$rc" ]] && ! grep -q "$exec_string" "$HOME/.$rc"; then
- echo -e "\n$exec_string" >> "$HOME/.$rc"
- echo "== Added SCM Breeze to '~/.$rc'"
+ if [ -s "$HOME/.$rc" ] && ! grep -q "$exec_string" "$HOME/.$rc"; then
+ printf "\n$exec_string\n" >> "$HOME/.$rc"
+ printf "== Added SCM Breeze to '~/.$rc'\n"
fi
done

0 comments on commit 0d7ee48

Please sign in to comment.