I think I'm having optical illusions...
# | aaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccc - 95 | #
# | dddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffgggggggggggggggggggg - 95 | #
This is the console input:
[~/prjs/SWARM] 130 $ . ./runtime
........[~/prjs/SWARM] 0 $ title aaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccdddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffgggggggggggggggggggg
Am I doing something wrong here?
# Before we attempt to print anything, lets check about the length
local len_strings_total=$(( $lenEvalLeft + $lenEvalMiddle + $lenEvalRight ))
if [[ ${len_strings_total:-0} -gt $COLUMNS ]]
then case "$MODE" in
"basic")
echo TODO $MODE width
;;
"title")
#header "${#1} -- $1"
local tmp_half=$(( ${#1} / 2 ))
local tmp_first="${1:0:$tmp_half}"
local tmp_second="${1:$tmp_half}"
title "$tmp_first - ${#tmp_first}"
title "$tmp_second - ${#tmp_second}"
return 0
;;
"header")
echo TODO $MODE width
;;
esac
fi
My biggest confusion here right now is that I expect both, tmp_first and tmp_second to be 50% of the passed argument, and they seem to be, at least the string length says so, but it does not look like it..
Hence my confusion.
Can anyone shed some light on this please?
Thank you in advance!