How to get full width of screen, when using large calculation with bc ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get full width of screen, when using large calculation with bc ?
# 1  
Old 02-27-2013
How to get full width of screen, when using large calculation with bc ?

Experts,

When doing large calculation the digits in the screen are limiting to 68 digit and then with a \ ( backspace) next line comes.

example:
Code:
ubuntu# echo "123456789 ^ 50 " | bc
37648602365872212683379005814670372328125515868188009630652959693316\
53227365756802769371000498888439396270561551204407017528155137509115\
30628997783758432567282528393435095577700662612703064145756763013199\
75186423794103895309927964392119588899253858187348437967568218742276\
11388639044429599087967879460298055070549932421946383277897148516959\
04443763894833957041176045572066607958236727487504380299754283001
#

My screen is big enough with good resolution , but the lines are not spreading in the entire screen. Any advise,


The output wanted to be spread to 255 width , Like below:
Code:
37648602365872212683379005814670372328125515868188009630652959693316532273657568027693710004988884393962705615512044070175281551375091153062899778375843256728252839343509557770066261270306414575676301319975186423794103895309927964392119588899
2538581873484379675682187422761138863904442959908796787946029805507054993242194638327789714851695904443763894833957041176045572066607958236727487504380299754283001

Thanks,
# 2  
Old 02-27-2013
Don't think bc supports wide output.

It uses readline, however so there are no issues with editing wide input lines, so that is one thing I suppose.
This User Gave Thanks to Chubler_XL For This Post:
# 3  
Old 02-28-2013
Try the following
Code:
echo "123456789 ^ 50" | bc | tr -d '\n\\' | fold -w 255

This User Gave Thanks to fpmurphy For This Post:
# 4  
Old 03-01-2013
fpmurphy ,
That works great , thanks a lot....
# 5  
Old 03-01-2013
Code:
awk 'BEGIN {print 1234567^50}'

awk does not support as large number as bc does.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Red Hat

How to know full width blade or half width blade?

HI, How do we figure out if the server is half blade server or full blade server? Anything we need to look at to know on this? thanks in advance (9 Replies)
Discussion started by: snchaudhari2
9 Replies

2. UNIX for Dummies Questions & Answers

Accidentally made a screen within a screen - how to move it up one level?

I made a screen within a screen. Is there a way to move the inner screen up one level so that it is at the same level as the first screen running from the shell? (2 Replies)
Discussion started by: phpchick
2 Replies

3. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

4. Solaris

How to safely copy full filesystems with large files (10Gb files)

Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS. I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies

5. UNIX for Dummies Questions & Answers

calculation on a large file

Trying to do some simple maths on a large file. Excel works fine but I have 1 million entries: If the difference between a number in column 2 and the one above it is more than 100 the insert a new line 8 4001 4100 8 4101 4200 8 4201 4300 8 15901 16000 8 15910 ... (1 Reply)
Discussion started by: dr_sabz
1 Replies

6. UNIX and Linux Applications

xlib: allow overlay of other windows in full-screen

Hi, I am using the feh slideshow program in full-screen mode. While the slide show is in progress I would like to draw some other windows (something like clock or calendar from gdesklets) on top of this slideshow. Currently feh does not allow me to do that. Below is the code that feh uses to... (0 Replies)
Discussion started by: aerosmith
0 Replies

7. Shell Programming and Scripting

Help In Calculation of large values in loop

Hi Gurus, I am writing a shell script in which i need to strip out the numbers from file the values are unknown i. e. the range cannot be predicted.. and in my current program the sum of values is not coming as desired i think the value of calculation is crossing the range i.e. after some... (6 Replies)
Discussion started by: sandeepb
6 Replies

8. Shell Programming and Scripting

Full-Screen Script

Hi guys Pls I would like knew how to execut a script in full-screen. My shell is Korn in HP-UX 10.20. Thanks. Morcegao (1 Reply)
Discussion started by: Morcegao30
1 Replies
Login or Register to Ask a Question