quantumpotato
quantumpotato

Reputation: 9767

dc input base must be a number between 2 and 16 inclusive

Called with ./dice.sh 1 1 1 1

I get dc input base must be a number between 2 and 16 inclusive

vim dice.sh
dice=0$(echo $* | tr -d [:space:] | tr 1-6 0-5)
eval "hex=$(dc -e 16o6i${dice}p)"

# Print the last 64 hex digits of the output:
echo $hex | sed -e 's/.*\(.\{64\}\)$/\1/'

Why is this error occurring? I'd like to understand why this is happening.

Upvotes: 0

Views: 84

Answers (0)

Related Questions