bc

GNU bc

Installation

Ubuntu
apt install bc
Alma Linux
dnf install bc

Examples

Fibonacci Numbers
#!/bin/bash

bc -q <<EOF
# Fibonacci Numbers
define fib(n) {
    if (n < 2) {
        return n
    } else {
        return fib(n - 2) + fib(n - 1)
    }
}

n = $1
print fib(n)
quit
/*
    example
        bash fib.sh 30
*/
EOF