Permalink
Browse files

swap echo for printf. closes #44

  • Loading branch information...
1 parent 36918eb commit 8d1ec71f4cb1b5c0134e2b91e59b1b38da37fdb9 @tj tj committed Dec 8, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 bin/n
View
14 bin/n
@@ -11,15 +11,15 @@ VERSIONS_DIR=$N_PREFIX/n/versions
#
log() {
- echo "\033[90m...\033[0m $@"
+ echo "\e[90m...\e[0m $@\n"
}
#
# Exit with the given <msg ...>
#
abort() {
- echo "\033[31mError: $@\033[0m" && exit 1
+ printf "\e[31mError: $@\e[0m\n" && exit 1
}
# setup
@@ -112,9 +112,9 @@ display_versions() {
local version=${dir##*/}
local config=`test -f $dir/.config && cat $dir/.config`
if test "$version" = "$active"; then
- echo " \033[32mο\033[0m $version \033[90m$config\033[0m"
+ printf " \e[32mο\e[0m $version \e[90m$config\e[0m\n"
else
- echo " $version \033[90m$config\033[0m"
+ printf " $version \e[90m$config\e[0m\n"
fi
done
}
@@ -290,12 +290,12 @@ list_versions() {
for v in $versions; do
if test "$active" = "$v"; then
- echo " \033[32mο\033[0m $v \033[0m"
+ printf " \e[32mο\e[0m $v \e[0m\n"
else
if test -d $VERSIONS_DIR/$v; then
- echo " * $v \033[0m"
+ printf " * $v \e[0m\n"
else
- echo " $v"
+ printf " $v\n"
fi
fi
done

0 comments on commit 8d1ec71

Please sign in to comment.