3

For large outputs bc utility in unix gives output in this format:

$ bc
bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.     
2^1000
10715086071862673209484250490600018105614048117055336074437503883703\
51051124936122493198378815695858127594672917553146825187145285692314\
04359845775746985748039345677748242309854210746050623711418779541821\
53046474983581941267398767559165543946077062914571196477686542167660\
429831652624386837205668069376

Is it possible to add formatting options so that it give the output in just 1 line

4
  • My bc doesn't do that. What operation did you perform to get that output? And what version of bc?
    – lurker
    Commented Sep 28, 2013 at 0:08
  • $ bc bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. 2^1000 10715086071862673209484250490600018105614048117055336074437503883703\ 51051124936122493198378815695858127594672917553146825187145285692314\ 04359845775746985748039345677748242309854210746050623711418779541821\ 53046474983581941267398767559165543946077062914571196477686542167660\ 429831652624386837205668069376
    – arunmoezhi
    Commented Sep 28, 2013 at 0:11
  • Ah those numbers are a lot longer than your example. Mine does that, too.
    – lurker
    Commented Sep 28, 2013 at 0:17
  • I will modify the question to reflect a valid case
    – arunmoezhi
    Commented Sep 28, 2013 at 0:18

1 Answer 1

7

Try setting the BC_LINE_LENGTH environment variable as documented here.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.