0

I am running Cygwin on windows 7 32 bit. I need to calculate using a single command so, to do that i typed: echo "2+4"|bc This shows me: -bash: bc: command not found. Does anyone help me in getting the result.

iehrlich
  • 3,572
  • 4
  • 34
  • 43
  • 4
    Possible duplicate of [BC command not working in CYGWIN](https://stackoverflow.com/questions/39054508/bc-command-not-working-in-cygwin) – Dalton Cézane Jul 20 '17 at 06:13
  • The `bc` command is not installed. You have to use the Cygwin setup to install the package that contains it. – axiac Jul 20 '17 at 17:38

1 Answers1

0

The command bc is probably not installed on your cygwin environment. You can use straight up bash calculation for simple math like that by doing echo $((2+4)).

PressingOnAlways
  • 11,948
  • 6
  • 32
  • 59