1.

Solve : Divide and multiply standard output??

Answer»

Very new to *ix so I appreciate any help.  This is, I'm sure, very simple for most, but I need to divide and multiply STANDARD output and don't know how to get BC to do it.

I have:

(bunch of stuff) = number I need to multiply or divide | ?

So the number is hanging at the end of that pipe.  Then what?

Thanks,

Danthen | bc, | PIPES the output STRAIGHT to bc.

# echo '38*67' | bc
2546
# echo '(12^2)^3' | bc
2985984

for instance.

more about pipes: http://www.linfo.org/pipes.html



Discussion

No Comment Found