Simple calculation (math) in Bash using ‘bc’

By neokrates, written on September 6, 2010

bash   snippet

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • Which SQL implementations are mostly used in your projects?

    • MySQL (44%, 4 Votes)
    • We don't use SQL (44%, 4 Votes)
    • MS SQL Server (22%, 2 Votes)
    • Oracle (11%, 1 Votes)
    • Standard (0%, 0 Votes)
    • PostgreSQL (0%, 0 Votes)
    • DB2 (0%, 0 Votes)
    • mSQL (0%, 0 Votes)
    • Informix (0%, 0 Votes)
    • Something else (0%, 0 Votes)

    Total Voters: 9

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:
user@host:~$ echo "1+2.3"|bc
3.3
user@host:~$ echo "1-2.3"|bc
-1.3
user@host:~$ echo "1.2*2.3"|bc
2.7
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)
0 votes 'YES'  0 votes 'NO'
TAGS
RELATED
Pages
Posts
    nope :(
SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

Leave a Reply