You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when feeding spark with numbers that have leading zeroes bash will eventually report an error when encountering numbers with 8 and 9 (e.g. 08, 09 etc) because bash automatically considers zero-leaded numbers as octals.
possible solution: strip leading zeroes. i have modified the spark() function in my testing spark fork:
n=${n%%.*}
# These 3 lines strip leading zeroes and fix error parsing octal-like numbers (008 etc) / tivasyk
shopt -s extglob
n=${n##+(0)}
shopt -u extglob
# Fix empty n if it was 0
if [[ $n -eq "" ]]; then
n=0
fi
it works, sorry for lame code.
p.s. great script! love it absolutely. i had to add scaling option (e.g. spark -s 100 ) to do things like cpu load gauges for conky etc. to be able to represent percentage data (0..100) in a meaningfull way.
The text was updated successfully, but these errors were encountered:
when feeding spark with numbers that have leading zeroes bash will eventually report an error when encountering numbers with 8 and 9 (e.g. 08, 09 etc) because bash automatically considers zero-leaded numbers as octals.
possible solution: strip leading zeroes. i have modified the spark() function in my testing spark fork:
it works, sorry for lame code.
p.s. great script! love it absolutely. i had to add scaling option (e.g. spark -s 100 ) to do things like cpu load gauges for conky etc. to be able to represent percentage data (0..100) in a meaningfull way.
The text was updated successfully, but these errors were encountered: