Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/sparkline

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

rfork e

if (~ $#* 0) {
	echo 'usage: '$0' n [n...]' >[1=2]
	exit usage
}

s=`{echo  $* | tr \x20 \x0a | sort -n}
min=$s(1)
max=$s($#s)
e=`{echo 'int((xxx - min) / ((max - min)/8))' | sed 's/max/'$max'/g; s/min/'$min'/g'}
nl='
'
echo $* | tr \x20 \x0a | sed 's/.*/xxx=&/g; a\'$nl$"e | hoc |
	tr -d ' '$nl |
	tr 012345678 ▁▂▃▄▅▆▇██
echo


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].