From f4c62f278444fb20deb7bf3f5ec2753a002dd4b6 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 26 Mar 2015 10:00:58 +0100 Subject: [PATCH] Correct variable incrementation ((LINE++)) only work with BASH. For SH: LINE=$((LINE+1)) --- dynmotd_scripts/04filesystem | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dynmotd_scripts/04filesystem b/dynmotd_scripts/04filesystem index 09bf851..de1220d 100755 --- a/dynmotd_scripts/04filesystem +++ b/dynmotd_scripts/04filesystem @@ -45,7 +45,8 @@ if [ $(which zpool) ]; then PART_NAME=$(df -T | grep zfs | sed -n "${LINE},${LINE}p" | awk '{print $1}') DISK_USAGE=$(df -T | grep zfs | sed -n "${LINE},${LINE}p" | awk '{print $6}') printf '%b' "\n${MAGENTA}+ ${WHITEB}${PART_NAME}${RESET} [ ${DISK_USAGE} ] " - (( LINE++ )) + LINE=$((LINE+1)) + # Bash ONLY: (( LINE++ )) done fi ### FI ZFS