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)
Hi I want to create a list of percentages but the shell script is bugging me.
If if I want to resolve the percentage of the quota used I get 0 because the schell script rounds by default.
Example
w1=860
w2=1024
w3=$((($w1/$w2)*100))
Echo $w3 gives 0
When I divide w1 by w2 the result... (13 Replies)
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)
I have a file with the following content.
> cat /tmp/internetusage.txt
6709.296322 30000 2/7/2010 0.00I am using the following awk command to calculate a percentage from field 1 and 2 from the file.
awk '{ print $1/$2*100 }' /tmp/internetusage.txt
This outputs the value "22.3643" as a... (1 Reply)
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)
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)
Hello,
My round and floor functions in C program behaves weird. Can someone help resolve the issue..
fprintf( fp, "ROUND TEST VARIABLE 11686776.000000 %d\n", round(11686776.000000));
fprintf( fp, "ROUND TEST VARIABLE 1168677.000000 %d\n", round(1168677.000000));
fprintf( fp, "FLOOR... (3 Replies)
Discussion started by: anijan
3 Replies
LEARN ABOUT REDHAT
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)