From 46a264249e6c0fe2961183760b23824b10f6f7b8 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 27 Jan 2013 22:40:40 -0600 Subject: [PATCH] * usr/bin/byobu-select-profile, usr/bin/byobu-ugraph, usr/lib/byobu/include/cycle-status, usr/lib/byobu/ip_address, usr/lib/byobu/memory: - the sed found in Mac OS X seems to really prefer a -e before expression --- debian/changelog | 4 ++++ usr/bin/byobu-select-profile | 2 +- usr/bin/byobu-ugraph | 2 +- usr/lib/byobu/include/cycle-status | 4 ++-- usr/lib/byobu/ip_address | 2 +- usr/lib/byobu/memory | 6 +++--- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index c60090b1..a6d56aeb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,10 @@ byobu (5.30) unreleased; urgency=low - find a suitable hash sum utility (fixes Mac OS X) * usr/lib/byobu/uptime: - handle multiple white space with a single digit hour on Mac OS X + * usr/bin/byobu-select-profile, usr/bin/byobu-ugraph, + usr/lib/byobu/include/cycle-status, usr/lib/byobu/ip_address, + usr/lib/byobu/memory: + - the sed found in Mac OS X seems to really prefer a -e before expression -- Dustin Kirkland Sat, 19 Jan 2013 14:18:01 -0600 diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index b1661f10..cecf93b4 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -186,7 +186,7 @@ setcolor_screen() { get_contrast() { # See section 2.2: http://www.w3.org/TR/AERT - local hex="$(echo "$1" | sed "s/\(..\)\(..\)\(..\)/\1 \2 \3/")" + local hex="$(echo "$1" | sed -e "s/\(..\)\(..\)\(..\)/\1 \2 \3/")" local bright=$(echo $hex | awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}') if [ $bright -ge 130 ]; then _RET="black" diff --git a/usr/bin/byobu-ugraph b/usr/bin/byobu-ugraph index 94217a94..91b41037 100755 --- a/usr/bin/byobu-ugraph +++ b/usr/bin/byobu-ugraph @@ -81,7 +81,7 @@ Examples: Trailing echo adds a required newline Note no filename specified. - $script_name "(/usr/lib/byobu/mem_used |sed 's/% //g';echo)" + $script_name "(/usr/lib/byobu/mem_used | sed -e 's/% //g';echo)" Using $script_name just to rotate log and display the graph diff --git a/usr/lib/byobu/include/cycle-status b/usr/lib/byobu/include/cycle-status index f844da21..04087f6a 100755 --- a/usr/lib/byobu/include/cycle-status +++ b/usr/lib/byobu/include/cycle-status @@ -35,7 +35,7 @@ for i in $all $all; do done # Disable all -sed -i "s/^tmux_right=/#tmux_right=/" "$BYOBU_CONFIG_DIR/status" +sed -i -e "s/^tmux_right=/#tmux_right=/" "$BYOBU_CONFIG_DIR/status" # Enable the next one -sed -i "${next}s/^#tmux_right=/tmux_right=/" "$BYOBU_CONFIG_DIR/status" +sed -i -e "${next}s/^#tmux_right=/tmux_right=/" "$BYOBU_CONFIG_DIR/status" diff --git a/usr/lib/byobu/ip_address b/usr/lib/byobu/ip_address index eadaa4a2..7e8278ac 100755 --- a/usr/lib/byobu/ip_address +++ b/usr/lib/byobu/ip_address @@ -49,7 +49,7 @@ __ip_address() { if [ -x /sbin/ip ]; then LC_ALL=C /sbin/ip -6 addr list dev "$interface" scope global >"$cache" 2>/dev/null & elif $BYOBU_TEST ifconfig >/dev/null 2>&1; then - LC_ALL=c ifconfig "$interface" | grep "inet6 " | awk '{print $2}' | sed "s/%.*//" >"$cache" 2>/dev/null & + LC_ALL=c ifconfig "$interface" | grep "inet6 " | awk '{print $2}' | sed -e "s/%.*//" >"$cache" 2>/dev/null & fi fi diff --git a/usr/lib/byobu/memory b/usr/lib/byobu/memory index ee84ff5e..7917ea30 100755 --- a/usr/lib/byobu/memory +++ b/usr/lib/byobu/memory @@ -39,9 +39,9 @@ __memory() { elif $BYOBU_TEST vm_stat >/dev/null 2>&1; then # MacOS support # calculation borrowed from http://apple.stackexchange.com/a/48195/18857 - free_blocks=$(vm_stat | grep free | awk '{ print $3 }' | sed 's/\.//') - inactive_blocks=$(vm_stat | grep inactive | awk '{ print $3 }' | sed 's/\.//') - speculative_blocks=$(vm_stat | grep speculative | awk '{ print $3 }' | sed 's/\.//') + free_blocks=$(vm_stat | grep free | awk '{ print $3 }' | sed -e 's/\.//') + inactive_blocks=$(vm_stat | grep inactive | awk '{ print $3 }' | sed -e 's/\.//') + speculative_blocks=$(vm_stat | grep speculative | awk '{ print $3 }' | sed -e 's/\.//') free=$((($free_blocks+speculative_blocks)*4)) inactive=$(($inactive_blocks*4)) total=$((($free+$inactive)))