10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Guys,
I have a floating point number 1.14475E+15 I want to convert this number in to full number (Integer or Big integer). I tried couple of functions it did not work. When I use INT=${FLOAT/.*} I am getting value as 1. I don't want a truncated value
#!/bin/bash
#... (9 Replies)
Discussion started by: skatpally
9 Replies
2. UNIX for Dummies Questions & Answers
I am trying to compare the floating number variables but i am receiving an error, can you please help what is wrong. Thank you.
#!/bin/bash
var1=100.25
var2=100.25
if (( $var1 == $var2 )); then
echo "Matching"
else
echo "Not Matching"
fi
Error:
./number.sh: line... (6 Replies)
Discussion started by: Ariean
6 Replies
3. Shell Programming and Scripting
I have a number, which I want to convert into the nearest floating number upto two places after the decimal point.
E.g.
1.2346 will become 1.23
but
1.2356 will become 1.24 .
Similarly
0.009 will be 0.01
and
0.001 will be 0.00 or 0.0 (not 0, wnat to keep the decimal... (1 Reply)
Discussion started by: hbar
1 Replies
4. Shell Programming and Scripting
Hi Guru's,
I am trying to grep a range of line numbers (based on match) and then look for another match which starts with a special character '$' and print the line number. I have the below code but it is actually printing the line number counting starting from the first line of the range i am... (15 Replies)
Discussion started by: Kevin Tivoli
15 Replies
5. Shell Programming and Scripting
Hey again,
I have a basic regex that tests if a number is a float.
Thank you. (5 Replies)
Discussion started by: whyte_rhyno
5 Replies
6. Shell Programming and Scripting
Hi !
How to increment a varibale in ksh.
#!/bin/ksh
set -x
RELEASE_NUM=5.2.103
VAL=0.0.1
RELEASE_NUM=`echo $RELEASE_NUM + $VAL | bc`
echo $RELEASE_NUM
The above code is throwing this error.
+ RELEASE_NUM=5.2.103 (2 Replies)
Discussion started by: dashok.83
2 Replies
7. Shell Programming and Scripting
Hey,
I guess I am just to stupid and am not seeing the "wood for the trees", but I am always getting strange errors.
I want to create a mesh with coordinates like:
x y z
3.1 3.0 0.75 0 0 1
3.1 2.9 0.75 0 0 1
3.1 2.8 0.75 0 0 1
3.1 2.7 0.75 0 0 1
3.0 ... (10 Replies)
Discussion started by: ergy1983
10 Replies
8. Shell Programming and Scripting
Hello folks
I Hope everyone is fine. I am calculating number of bytes calculation from apache web log.
awk '{ sum += $10 } END { print sum }' /var/httpd/log/mydomain.log
7.45557e+09
it show above number, what should i do it sow number like 7455, i mean if after decimal point above 5 it... (5 Replies)
Discussion started by: learnbash
5 Replies
9. Shell Programming and Scripting
Hello gurus,
I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script.
i m looking for something like this
call 3.1;
If 3.1 = "complete" then
call 3.2;
if 3.2 = ''COMPlete" then
call 3.3;
else
exit
The... (1 Reply)
Discussion started by: shashi369
1 Replies
10. Shell Programming and Scripting
Hi,
I' using bash and I would like to use "bc" to compute the ratio of of two numbers and assign the ratio to a variable.
The numbers are in a file, e.g.
196.304492
615.348986
Any idea how to do it?
N.B. I cannot change the file to have 196.304492 / 615.348986 as the file is produced by... (14 Replies)
Discussion started by: f_o_555
14 Replies