From: Simon Ruderich Date: Mon, 15 Oct 2012 19:04:34 +0000 (+0200) Subject: setup.sh: Use test instead of [. X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=90691ed2f737abfe5e591e7971501a60fa72ac9c setup.sh: Use test instead of [. Also fix a comparison, `id -u` is a number. --- diff --git a/setup.sh b/setup.sh index 305c093..aa323ac 100755 --- a/setup.sh +++ b/setup.sh @@ -83,7 +83,7 @@ if test -z "$use_256colors"; then fi # Some options are only necessary when running as root. They are marked as # "(ROOT)". -if [ x`id -u` != x0 ]; then +if test "`id -u`" -ne 0; then echo screenrc: removing root options grep -v '(ROOT)' screenrc > screenrc.tmp mv screenrc.tmp screenrc @@ -104,7 +104,7 @@ if installed rxvt; then fi # Display current battery charge on computers with a battery. Necessary lines # are marked as "(BATTERY)". -if [ ! -d /sys/class/power_supply/BAT0 ]; then +if test ! -d /sys/class/power_supply/BAT0; then echo screenrc: removing battery display grep -v '(BATTERY)' screenrc > screenrc.tmp mv screenrc.tmp screenrc