{"id":1912,"date":"2022-03-04T22:12:24","date_gmt":"2022-03-04T16:42:24","guid":{"rendered":"https:\/\/smarttech101.com\/?p=1912"},"modified":"2023-03-25T00:52:09","modified_gmt":"2023-03-24T19:22:09","slug":"bc-command-in-linux","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/bc-command-in-linux\/","title":{"rendered":"bc command in Linux"},"content":{"rendered":"\n

bc command in Linux is actually a calculator “language”. It comes preinstalled with Linux. Like bash and zsh, you can use it in interactive mode (i.e. type bc in your terminal, hit Enter button, put your equations and get your answers) as well as in shell scripts.<\/p>\n\n\n\n

Some people like to call it the “Basic Calculator<\/strong>” and discard it altogether. But I call it the “Best Calculator”<\/strong> because it provides advanced facilities as well – It has for<\/code> and while<\/code> loops, and if-else statements, among others with syntax similar to the C programming language.<\/p>\n\n\n\n

Here, in this article, I will touch upon its basic applications and how I use it in the shell scripts and in its interactive mode.<\/p>\n\n\n\n

Table of contents<\/h2>\n\n\n\n