diff options
author | Colin Walters <walters@verbum.org> | 2011-06-22 15:53:42 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2011-06-22 15:53:42 -0400 |
commit | 7f977b0214623142819c8b7a08839949fb9f3ec0 (patch) | |
tree | 8515bd6d0e909c4ec84d8ad96c15bf9cb22d65a9 | |
parent | ee256d60790a464ca56b452c0a70ad0c03547519 (diff) | |
download | gnome-common-7f977b0214623142819c8b7a08839949fb9f3ec0.tar.gz |
gnome-autogen.sh: Don't print terminal codes if stdin isn't a tty3.1.0
Otherwise this shows up as garbage in log files.
-rw-r--r-- | macros2/gnome-autogen.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/macros2/gnome-autogen.sh b/macros2/gnome-autogen.sh index ead647a..9967f89 100644 --- a/macros2/gnome-autogen.sh +++ b/macros2/gnome-autogen.sh @@ -36,8 +36,13 @@ case `echo -n x` in esac # some terminal codes ... -boldface="`tput bold 2>/dev/null`" -normal="`tput sgr0 2>/dev/null`" +if tty < /dev/null 1>/dev/null 2>&1; then + boldface="`tput bold 2>/dev/null`" + normal="`tput sgr0 2>/dev/null`" +else + boldface= + normal= +fi printbold() { echo $ECHO_N "$boldface" $ECHO_C echo "$@" |