02-15-2007
check whether the directory in which bc lives is in the $PATH
usually it should be as
/usr/bin/bc
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
In a unix shell script,i want to round a variabele to a nearest number
Ex: set count=104.4
How can i round that to 105.?
Thanks,
Sateesh (2 Replies)
Discussion started by: kotasateesh
2 Replies
2. Shell Programming and Scripting
Is there an easy way to round a number up in Korn shell?
ie. 10.4 --> 11
Thanks. (6 Replies)
Discussion started by: here2learn
6 Replies
3. Shell Programming and Scripting
In a shell script - How do I round a decimal number (contained in a variable) to the nearest whole number? (2 Replies)
Discussion started by: achieve
2 Replies
4. Shell Programming and Scripting
Hi ....
Iam having the file ....in which 3rd column is numerical having 8 decimal part... i want that to cut to 2 decimal part ...
Source File :
E100|0|19940.10104030|0|1ABC
E103|1|19942.10195849|3|0ABC
E100|0|19943.10284858|0|1ABC
I want to be ......
Reulst:
... (4 Replies)
Discussion started by: satyam_sat
4 Replies
5. Shell Programming and Scripting
Hi, I have a problem. Basically I dont know how to use awk. I have a script (below) which works fine.
What I want to do is somehow "pipe" in the input say 4.5 and have it give the anwer, I dont want ot have to type it in, since it will be running in a script.
Any ideas how to do this????
... (1 Reply)
Discussion started by: AnnaLynn
1 Replies
6. Shell Programming and Scripting
HI,
I have a script which is used to calculate the Memory & CPU utilization a server.
memx=`ssh -l siebel1 ${f} /usr/sbin/prtconf|grep -i 'Memory size'|tr -s " "|/usr/xpg4/bin/awk -F" " '{print $3 * 1024}'`
v5=`ssh -l siebel1 ${f} vmstat 1 2 | tail -1 | tr -s " " | /usr/xpg4/bin/awk -v... (3 Replies)
Discussion started by: dear_abhi2007
3 Replies
7. Shell Programming and Scripting
Hello,
I am searching for a way to calculate for example 10/100 within a shellscript and the result should be 0.1 and not just 0.
Every alternative i tried just results 0
Thank you in advance
2retti (6 Replies)
Discussion started by: 2retti
6 Replies
8. UNIX for Dummies Questions & Answers
hi,
The below commands result only the whole number(not giving the decimal values).
pandeeswaran@ubuntu:~$ echo 1,2,3,4|sed 's/,/\//g'|bc
0
pandeeswaran@ubuntu:~$ echo 1000,2,3|sed 's/,/\//g'|bc
166
How to make it to return the decimal values?
Thanks (5 Replies)
Discussion started by: pandeesh
5 Replies
9. Shell Programming and Scripting
Hi All,
I would like to do the following in the shell script
561.76 to 562
I tried using this echo 'scale=0; 749 * 75 /100 ' | bc
but just returned only 561
Please help me . I appreciate your help
Thanks
rajeevm (13 Replies)
Discussion started by: rajeevm
13 Replies
10. Shell Programming and Scripting
Hi, all
I have a field in a file looks like this(hundreds of lines):
inf
1.24101
-0.185947
-0.349179
inf
0.126597
0.240142
-0.12031And what I expect is:
inf
1.241
-0.186
-0.349
inf
0.127 (7 Replies)
Discussion started by: nengcheng
7 Replies