* usr/bin/byobu-status, usr/lib/byobu/include/constants:

- use printf instead of echo, saves a few forks
This commit is contained in:
Dustin Kirkland 2012-02-12 09:11:08 -06:00
commit 80236e5a40
3 changed files with 6 additions and 4 deletions

2
debian/changelog vendored
View file

@ -18,6 +18,8 @@ byobu (5.8) unreleased; urgency=low
- do a better job counting ssh users - do a better job counting ssh users
* usr/share/byobu/status/status: * usr/share/byobu/status/status:
- move wifi_quality to second right status - move wifi_quality to second right status
* usr/bin/byobu-status, usr/lib/byobu/include/constants:
- use printf instead of echo, saves a few forks
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 30 Jan 2012 18:12:49 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Mon, 30 Jan 2012 18:12:49 -0600

View file

@ -69,10 +69,10 @@ get_status() {
# Update cache now, if necessary # Update cache now, if necessary
if [ $NOW -ge $expiry ] || [ "$lastrun" = "0" ]; then if [ $NOW -ge $expiry ] || [ "$lastrun" = "0" ]; then
"__$function" > "$cachepath" "__$function" > "$cachepath"
echo "$NOW" > "$lastpath" printf "%s" "$NOW" > "$lastpath"
fi fi
if [ -s "$cachepath" ]; then if [ -s "$cachepath" ]; then
IFS= read line < "$cachepath"; printf "$line" IFS= read line < "$cachepath"; printf "%s" "$line"
fi fi
} }
@ -87,7 +87,7 @@ case "$1" in
--detail) --detail)
VER= VER=
if command -v dpkg-query >/dev/null; then if command -v dpkg-query >/dev/null; then
VER=$(set -- $(dpkg-query --show $PKG); echo "$2") VER=$(set -- $(dpkg-query --show $PKG); printf "%s\n" "$2")
fi fi
printf "$PKG-$VER Detailed Status Navigation\n" printf "$PKG-$VER Detailed Status Navigation\n"
if command -v vim >/dev/null && `vim --version | grep -q +folding`; then if command -v vim >/dev/null && `vim --version | grep -q +folding`; then

View file

@ -73,7 +73,7 @@ else
ICON_GHz="GHz" ICON_GHz="GHz"
ICON_MBPS="Mbps" ICON_MBPS="Mbps"
fi fi
PCT="%%" PCT="%"
# Support two different backends (screen/tmux) # Support two different backends (screen/tmux)
if [ -z "$BYOBU_BACKEND" ]; then if [ -z "$BYOBU_BACKEND" ]; then