I need help please bc calculator

amel

New Member
Joined
Dec 5, 2021
Messages
1
Reaction score
0
Credits
11
Hello!!
I have a problem so please help me. I want to use bc calculator with redirections and i want the result on the screen and then in a file. how can i do this??
Thank you
 


The link posted by @Lord Boltar should get you started with bc.

And to get the last part - the result displayed on screen AND redirected to a file - simply pipe the output from bc to the tee command and specify the name of the file to write to.

e.g.
Bash:
echo "5+7" | bc -l | tee /path/to/outputfile
That will echo the result of the calculation to the screen and to a file.
 
And to get the last part - the result displayed on screen AND redirected to a file - simply pipe the output from bc to the tee command and specify the name of the file
 

Members online


Latest posts

Top