💾 Archived View for ait.place › dot › bin › .local › bin › roll.txt captured on 2021-12-05 at 23:47:19.

View Raw

More Information

⬅️ Previous capture (2021-12-03)

-=-=-=-=-=-=-

#!/bin/sh

input=$*

[ -z "$input" ] && input=2d20

for request in $input ; do
	# check if format is correct
	echo $request| egrep -vq '^[0-9]+d[0-9]+


 && continue

	# Print and roll the dice
	shuf -r -i 1-$(echo $request|cut -dd -f2) -n $(echo $request|cut -dd -f1)
done