Skip to main content
That `bc -q` (and the need for it) is GNU-specific, I'm not aware of other implementations with a similar issue
Source Link
Stéphane Chazelas
  • 586.8k
  • 96
  • 1.1k
  • 1.7k

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

The GNU implementation of bc -q will jump into bc right away without theprints that header/copyright info on start-up when both its stdin and stdout go to a terminal. You can suppress it with the (GNU-specific) -q option. For more information see the bc man page

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc -q will jump into bc right away without the header/copyright info. For more information see the bc man page

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

The GNU implementation of bc prints that header/copyright info on start-up when both its stdin and stdout go to a terminal. You can suppress it with the (GNU-specific) -q option. For more information see the bc man page

removed reference to defunct link
Source Link
Levon
  • 11.7k
  • 4
  • 48
  • 41

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc -q will jump into bc right away without the header/copyright info. For more information see the bc man page

This page also shows how to set up an alias or function to do calculation like this:

c "25 + 5" 

and get the result

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc -q will jump into bc right away without the header/copyright info. For more information see the bc man page

This page also shows how to set up an alias or function to do calculation like this:

c "25 + 5" 

and get the result

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc -q will jump into bc right away without the header/copyright info. For more information see the bc man page

added 47 characters in body
Source Link
Levon
  • 11.7k
  • 4
  • 48
  • 41

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

orAlternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc -q will jump into bc right away without the header/copyright info. For more information see the bc man page

This page also shows how to set up an alias or function to do calculation like this:

c "25 + 5" 

and get the result

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc man page

This page also shows how to set up an alias or function to do calculation like this:

c "25 + 5" 

and get the result

You could use bc. E.g.,

$ echo "25 + 5" | bc
30

Alternatively bc <<< 25+5 will also work.

Or interactively, if you want to do more than just a single simple calculation:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
25 + 5
30

bc -q will jump into bc right away without the header/copyright info. For more information see the bc man page

This page also shows how to set up an alias or function to do calculation like this:

c "25 + 5" 

and get the result

Source Link
Levon
  • 11.7k
  • 4
  • 48
  • 41
Loading