Skip to main content
Question Unprotected by AdminBee
removed (/bash) because (/shell) includes it and added (/arithmetic)
Link
user62916
user62916
Cleanup for clarity.
Source Link
dhag
  • 16.3k
  • 4
  • 57
  • 66

Using echo "20+5" literally produces the text "20+5".

What command can I use to get the numeric sum, e.g. 25 in this case.?

Also, what's the easiest way to do it just using bash for floating point, e.g.
point? For example, echo $((3224/3807.0)) gives prints 0 :(.

UsingI am looking for answers using either the basic command shell ('command line' line') itself or through using languages that are available atfrom the command command line.

Using echo "20+5" literally produces the text "20+5"

What command can I use to get the numeric sum, e.g. 25 in this case.

Also, what's the easiest way to do it just using bash for floating point, e.g.
echo $((3224/3807.0)) gives 0 :(

Using either the basic command shell ('command line') itself or through using languages that are available at the command line.

Using echo "20+5" literally produces the text "20+5".

What command can I use to get the numeric sum, 25 in this case?

Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.

I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line.

Question Protected by CommunityBot
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k
added 12 characters in body
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
edited title
Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
added 131 characters in body; edited title
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
edited title
Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
It's weird enough that there's a running answer that just incorporates all other answers; we don't need the question to answer itself as well
Source Link
Michael Mrozek
  • 95.8k
  • 40
  • 245
  • 236
Loading
fix calculation - 25+5 != 25
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
added Joe's answer in.
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
added Joe's answer in.
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
added 165 characters in body; edited title
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
edited tags
Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading
Tweeted twitter.com/#!/StackUnix/status/213308471397978113
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238
Loading