# echo statement

**URL:** <https://community.unix.com/t/echo-statement/150149>\
**Category:** Shell Programming and Scripting\
**Created:** [September 30, 2004, 7:03pm UTC](https://community.unix.com/t/echo-statement/150149 "2004-09-30T19:03:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![circleW](https://community.unix.com/letter_avatar/circlew/32/6_22734026db12803ebb3e059622ac3534.png) [@circleW](https://community.unix.com/u/circleW)\
**Post date:** [September 30, 2004, 7:03pm UTC](https://community.unix.com/t/echo-statement/150149/1 "2004-09-30T19:03:15Z")

</div>

Does anyone know the correct syntax for computing arithmetic expressions inside the echo statement? Let me know, thanks

---

<div class="post-metadata">

**Author:** ![norsk\_hedensk](https://community.unix.com/letter_avatar/norsk_hedensk/32/6_22734026db12803ebb3e059622ac3534.png) [@norsk\_hedensk](https://community.unix.com/u/norsk_hedensk)\
**Post date:** [September 30, 2004, 8:44pm UTC](https://community.unix.com/t/echo-statement/150149/2 "2004-09-30T20:44:47Z")

</div>

you could store the results of the expression in a variable.

---

<div class="post-metadata">

**Author:** ![fdc](https://community.unix.com/letter_avatar/fdc/32/6_22734026db12803ebb3e059622ac3534.png) [@fdc](https://community.unix.com/u/fdc)\
**Post date:** [October 3, 2004, 10:23pm UTC](https://community.unix.com/t/echo-statement/150149/3 "2004-10-03T22:23:49Z")

</div>

echo doesn't know math. You want "expr".

---

<div class="post-metadata">

**Author:** ![circleW](https://community.unix.com/letter_avatar/circlew/32/6_22734026db12803ebb3e059622ac3534.png) [@circleW](https://community.unix.com/u/circleW)\
**Post date:** [October 3, 2004, 11:06pm UTC](https://community.unix.com/t/echo-statement/150149/4 "2004-10-03T23:06:16Z")

</div>

figured it out...thanks for the help
