* 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
* usr/share/byobu/status/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

View file

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

View file

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