From 97c3df898c08cb9fea6abee109a9c27781c426ea Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Wed, 28 Apr 2010 11:31:40 -0400 Subject: [PATCH] Use tabs instead of spaces in rcs_cost --- usr/lib/byobu/rcs_cost | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/usr/lib/byobu/rcs_cost b/usr/lib/byobu/rcs_cost index 6d9706ad..e2ff11f1 100755 --- a/usr/lib/byobu/rcs_cost +++ b/usr/lib/byobu/rcs_cost @@ -26,12 +26,12 @@ DETAIL=0 PKG="byobu" color 2>/dev/null || color() { true; } -for arg in "$@"; do - case "$arg" in - -d|--detail) - DETAIL=1 - ;; - esac +for arg in $@; do + case "$arg" in + -d|--detail) + DETAIL=1 + ;; + esac done # Approximate Instance Cost Basis @@ -53,7 +53,7 @@ memory=$((${memory} - (${memory} % (64 * 1024)))) # Apply the going rate INCREMENTS="256 512 1024 2048 4096 8192 16384 32768 65536" for X in ${INCREMENTS}; do - test "$((${X} * 1024 + 65536))" -ge ${memory} && break + test "$((${X} * 1024 + 65536))" -ge ${memory} && break done MEMORY_RATE=`echo "$X" | awk '{printf "%f", $1 / 256 * 15 / 1000}'` @@ -81,19 +81,19 @@ uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$MEMORY_RATE" * $hours}"` total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'` if [ "$DETAIL" = "1" ]; then - echo "==========================================================" - echo "Estimated cost in Rackspace Cloud Server since last reboot" - echo "==========================================================" - echo " Network sent: $tx_gb GB @ \$$RX_RATE/GB" - echo " Network recv: $rx_gb GB @ \$$TX_RATE/GB" - echo " Network cost: \$$network_cost" - echo "----------------------------------------------------------" - echo " Uptime: $hours hr @ \$$MEMORY_RATE/hr" - echo " Uptime cost: \$$uptime_cost" - echo "----------------------------------------------------------" - echo "Total cost: ~\$$total_cost" - echo "==========================================================" - exit 0 + echo "==========================================================" + echo "Estimated cost in Rackspace Cloud Server since last reboot" + echo "==========================================================" + echo " Network sent: $tx_gb GB @ \$$RX_RATE/GB" + echo " Network recv: $rx_gb GB @ \$$TX_RATE/GB" + echo " Network cost: \$$network_cost" + echo "----------------------------------------------------------" + echo " Uptime: $hours hr @ \$$MEMORY_RATE/hr" + echo " Uptime cost: \$$uptime_cost" + echo "----------------------------------------------------------" + echo "Total cost: ~\$$total_cost" + echo "==========================================================" + exit 0 fi printf "$(color K G)~\$$(color -)$(color b K G)%s$(color -) " $total_cost