From 1d635701bef725c6c277a65d3dcceaec34d1ea8a Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 9 Nov 2011 17:38:24 -0600 Subject: [PATCH] * experimental/byobu-classroom, usr/bin/byobu-ctrl-a, usr/bin/byobu- enable, usr/bin/byobu-select-backend, usr/bin/byobu-select-profile, usr/bin/byobu-ulevel, usr/lib/byobu/custom, usr/lib/byobu/disk, usr/share/byobu/tests/byobu-time-notifications: LP: #882814 - use printf instead of "echo -n" for portability to Mac OSX --- debian/changelog | 5 +++++ experimental/byobu-classroom | 4 ++-- usr/bin/byobu-ctrl-a | 2 +- usr/bin/byobu-enable | 2 +- usr/bin/byobu-select-backend | 2 +- usr/bin/byobu-select-profile | 6 +++--- usr/bin/byobu-ulevel | 2 +- usr/lib/byobu/custom | 2 +- usr/lib/byobu/disk | 4 ++-- usr/share/byobu/tests/byobu-time-notifications | 2 +- 10 files changed, 18 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 16edddf2..00c993a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -74,6 +74,11 @@ byobu (4.47) unreleased; urgency=low usr/share/doc/byobu/help.txt => usr/share/doc/byobu/help.screen.txt, usr/share/doc/byobu/Makefile.am: - show tmux help in tmux, screen help in screen + * experimental/byobu-classroom, usr/bin/byobu-ctrl-a, usr/bin/byobu- + enable, usr/bin/byobu-select-backend, usr/bin/byobu-select-profile, + usr/bin/byobu-ulevel, usr/lib/byobu/custom, usr/lib/byobu/disk, + usr/share/byobu/tests/byobu-time-notifications: LP: #882814 + - use printf instead of "echo -n" for portability to Mac OSX -- Dustin Kirkland Tue, 08 Nov 2011 19:16:15 -0600 diff --git a/experimental/byobu-classroom b/experimental/byobu-classroom index 60b31d65..355b0827 100755 --- a/experimental/byobu-classroom +++ b/experimental/byobu-classroom @@ -93,7 +93,7 @@ while [ $(stat -c%a "$screen") != "6755" ]; do echo ls -alF "$screen" info "To operate in classroom mode, $screen must have 6755 permissions." - echo -n "Do you want to set this now? [y/N]: " + printf "Do you want to set this now? [y/N]: " c=$(head -n1) case "$c" in y|Y) @@ -121,7 +121,7 @@ while [ $(grep -c "#byobu-classrom" /etc/ssh/sshd_config) != "4" ]; do info " b) disable TCP Forwarding" info " c) force the guest user's login command" echo - echo -n "Do you want to set these now? [y/N]: " + printf "Do you want to set these now? [y/N]: " c=$(head -n1) case "$c" in y|Y) diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index b69525d6..68131a1e 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -54,7 +54,7 @@ while [ -z "$bind_to" ]; do echo " - You can press F9 and choose your escape character" echo " - You can run 'byobu-ctrl-a' at any time to change your selection" echo - echo -n "Select [1 or 2]: " + printf "Select [1 or 2]: " s=$(head -n1) echo case "$s" in diff --git a/usr/bin/byobu-enable b/usr/bin/byobu-enable index a66c480a..494f7dff 100755 --- a/usr/bin/byobu-enable +++ b/usr/bin/byobu-enable @@ -29,7 +29,7 @@ echo echo "To disable this behavior later, just run:" echo " byobu-disable" echo -echo -n "Press to continue..." +printf "Press to continue..." $(head -n1) exec byobu diff --git a/usr/bin/byobu-select-backend b/usr/bin/byobu-select-backend index a06e50fa..3b9274fa 100755 --- a/usr/bin/byobu-select-backend +++ b/usr/bin/byobu-select-backend @@ -38,7 +38,7 @@ prompt() { echo " 1. screen" echo " 2. tmux" echo - echo -n "Choose 1-2 [2]: " + printf "Choose 1-2 [2]: " choice=$(head -n1) case $choice in 1) _RET="screen" ;; diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index 053a50ed..f53a3e88 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -94,7 +94,7 @@ prompt() { fi i=1 for x in $COLORS; do - test $i -lt 10 2>/dev/null && echo -n " " || echo -n " " + test $i -lt 10 2>/dev/null && printf " " || printf " " echo "$i. $x" i=$(expr $i + 1) [ "$simple" = "$x" ] && simple=$i @@ -103,10 +103,10 @@ prompt() { if [ -z "$selected" -a -n "$simple" ]; then selected="$simple" elif ! test $selected -gt 0 2>/dev/null; then - echo -n "`gettext 'Choose'` 1-$i [$simple]: " + printf "`gettext 'Choose'` 1-$i [$simple]: " selected=`head -n1` elif ! test $selected -le $i 2>/dev/null; then - echo -n "`gettext 'Choose'` 1-$i [$simple]: " + printf "`gettext 'Choose'` 1-$i [$simple]: " selected=`head -n1` else i=1 diff --git a/usr/bin/byobu-ulevel b/usr/bin/byobu-ulevel index bd68fc95..8a6e7709 100755 --- a/usr/bin/byobu-ulevel +++ b/usr/bin/byobu-ulevel @@ -371,7 +371,7 @@ list_theme() echo for c in $content do - echo -n "$c " + printf "$c " done echo -e "\n" } diff --git a/usr/lib/byobu/custom b/usr/lib/byobu/custom index ba71c247..f14c2032 100755 --- a/usr/lib/byobu/custom +++ b/usr/lib/byobu/custom @@ -53,7 +53,7 @@ __custom() { ;; esac done - echo -n "$output" | $SED ':a;N;$!ba;s/\n//g' + printf "$output" | $SED ':a;N;$!ba;s/\n//g' } # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/lib/byobu/disk b/usr/lib/byobu/disk index d343fd4a..dad75b4b 100755 --- a/usr/lib/byobu/disk +++ b/usr/lib/byobu/disk @@ -45,8 +45,8 @@ __disk() { t*|T*) unit="$ICON_TB" ;; esac _UNIT=${unit}; _SIZE=${size}; _PCT=${pct}; - color b M W; echo -n "$_SIZE"; color -; color M W; echo -n "${_UNIT}"; color -; - color b M W; echo -n "$_PCT"; color -; color M W; echo -n "$PCT" ; color --; + color b M W; printf "$_SIZE"; color -; color M W; printf "${_UNIT}"; color -; + color b M W; printf "$_PCT"; color -; color M W; printf "$PCT" ; color --; } # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/share/byobu/tests/byobu-time-notifications b/usr/share/byobu/tests/byobu-time-notifications index cd61d3f1..232a5fc4 100755 --- a/usr/share/byobu/tests/byobu-time-notifications +++ b/usr/share/byobu/tests/byobu-time-notifications @@ -43,6 +43,6 @@ for i in $list; do ;; esac freq=`grep "byobu-status $i$" /usr/share/$PKG/profiles/common | awk '{print $3}'` - echo -n "$i $freq " + printf "%s" "$i $freq " time loop $i done