Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- #
- mult=(2 9 8 7 6 3 4)
- clear
- read -ep $'\n\t CI: ' ci
- for (( i=0; i < 7; i++ )); do
- n=${ci:${i}:1}
- let "n *= ${mult[${i}]}"
- let "suma += $n"
- done
- digito=$( echo "scale=1; $suma / 10" | bc | cut -d '.' -f 2 )
- if [[ $digito -gt 0 ]]; then
- digito=$[ 10 - digito ]
- fi
- echo -e "\n\t D. Verificador: $digito \n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement