This is a bc output, e.g.:Input:echo scale=10; BLA-BLA-HERE-NOT-IMPORTANT | bcOutput: .3708446283953709207058828124021300754352578903651372655882743141882\77124645102027246581819139527644919407424570060822470537797066353573\96635.8038454068 daysTwo Questions:can the output be rounded to something like 0.3708...?can I remove the \n-s from the end?I can't find any max width option in bc.
BC - no \\n at the end + start with zeros?
bash;bc
You can try something like this code:echo scale = 4;  3.5678/3 | bc | tr '\n' ' 'Setting scale for bc is supposed to do the rounding job. You can substitute the division part with your desired command. The output of bc is again piped to tr, which converts the newline (\n) to white space. For the above command I get the following output:1.1892 user@localhost:~/codes$