>bc_
In computing,
Usually input is passed in using the
To exit the interactive mode, write quit.
bc
is a command in Unix operating systems that can do easy
calculations in the shell.Usually input is passed in using the
echo
command and pipes.
The name stands for Basic Calculator.echo "(12 / 2 - 3) * 3 + 1.5" | bc 10.5
Interactive mode
Using the interactive mode lets you do calculations freely in a special shell inside the shell. All you need to do is run the bc command with the-i
flag
and no parameters.To exit the interactive mode, write quit.
bc -i 1+1 2 (12 / 2 - 3) * 3 + 1.5 10.2 quit