From aed833058ffe2db7658bbf1f40c9c93c918550c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mah=C3=A9?= Date: Sat, 18 Jan 2014 16:37:52 +0100 Subject: [PATCH] Consistent style for loops (while and for) --- liquidprompt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/liquidprompt b/liquidprompt index 59a3605..1e00dc6 100755 --- a/liquidprompt +++ b/liquidprompt @@ -602,8 +602,7 @@ _lp_set_dirtrim() { local q="/${p##*/}" local show="$q" # +3 because of the ellipsis: "..." - while (( ${#show}+3 < max_len )) - do + while (( ${#show}+3 < max_len )); do (( dt++ )) p="${p%$q}" q="/${p##*/}" @@ -786,8 +785,7 @@ _lp_upwards_find() { local dir dir="$PWD" - while [[ -n "$dir" ]] - do + while [[ -n "$dir" ]]; do [[ -d "$dir/$1" ]] && return 0 dir="${dir%/*}" done @@ -1385,8 +1383,7 @@ _lp_temp_sensors() _lp_temp_acpi() { local i - for i in $(acpi -t | sed 's/.* \([0-9]*\)\.[0-9]* degrees C$/\1/p') - do + for i in $(acpi -t | sed 's/.* \([0-9]*\)\.[0-9]* degrees C$/\1/p'); do [[ $i -gt $temperature ]] && temperature=$i done }