Most POSIX systems come with GNUÂ bc, an arbitrary precision numeric processing language. Its syntax is similar to C, but it also supports interactive execution of statements and processing data from standard in (stdin). For that reason, it’s often the answer to the question, “How do I do math in the Linux shell?” This style of response is common online:read more
Source: LXer – Do math in the Linux shell with GNU bc