Sponsored Content
Top Forums Shell Programming and Scripting Need an AWK script to calculate the percentage Post 302255167 by bobprabhu on Thursday 6th of November 2008 03:06:11 AM
Old 11-06-2008
Hi Paresh n doshi
thanks for the logic.

"be carefule, the characters are not single quotes but the one above tab key." am not clear on this pharse.

I excuted the same as you said.

exp1=$sum*100/$failed
echo the failed percentage is 1 expr $exp1 | bc `
am geting ERROR:
syntax error at line 48 : ``'

i belive am missing some thing.
Please advice.
 

10 More Discussions You Might Find Interesting

1. Programming

how do I calculate percentage ?

int percent (int a, int b) { if (b/a*100 > 25) return TRUE; else return FALSE; } I want to calculate what percentage of a is b. say if b = 48, a = 100 so b is 48% of a but wouldnt b/a give me 0 ??? what can be done ?? (6 Replies)
Discussion started by: the_learner
6 Replies

2. Shell Programming and Scripting

How can i calculate percentage ??

i have 3 files like total.dat=18 equal.dat=14 notequal.dat=16 i need find the equal percentange means: equalpercentage = ($equal.dat / $total.dat * 100) How i can do this ? I tried some of the answers to calculate the percentage in this forums.but it couldn't worked.Some one please... (6 Replies)
Discussion started by: bobprabhu
6 Replies

3. Shell Programming and Scripting

Script shell, how to calculate percentage?

hello, please can you help me. jj and kk are two numbers which are the result of an sql program. I would like to calculate the ratio jj/kk*100. I have done this: ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0 What can i do? Thanks for help. (3 Replies)
Discussion started by: likeaix
3 Replies

4. Shell Programming and Scripting

How to calculate what percentage of X value is there in the file?

Input File: 5081 2058 175 8282 2358 7347 6612 3459 END OF INPUT FILE I need to know how to calculate minimum,maximum,average of the values in the file and also what percentage is the values over some user defined value for example 1000 and what percentage of value is over 5000. By... (2 Replies)
Discussion started by: aroragaurav.84
2 Replies

5. Shell Programming and Scripting

Need an awk script to calculate the percentage of value field and replace

Need an awk script to calculate the percentage of value field and replace I have a input file called file.txt with the following content: john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2 andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1 in fourth filed of input file, calulate percentage of each... (1 Reply)
Discussion started by: veeruasu
1 Replies

6. UNIX for Dummies Questions & Answers

Need an awk script to calculate the percentage of value field and replace

I have a input file called file.txt with the following content: john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2 andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1 in fourth filed of input file, calulate percentage of each sub filed seperated by ; semicolon and replace value with percentage . i... (11 Replies)
Discussion started by: veeruasu
11 Replies

7. Shell Programming and Scripting

Calculate percentage of a value accross m

I have 100 csv files like: file_city_1 file_city_2 file_city_3 file_city_4 City name is variable, there is 25 cities, each city has 4 region. Each of the 4 region contain some statistics like: parameter1 : number1 parameter1 : number2 ..... parameter50 : number50 ... (7 Replies)
Discussion started by: Meacham12
7 Replies

8. Shell Programming and Scripting

Calculate percentage of columns greater than certain value in a matrix using awk

This matrix represents correlation values. Is it possible to calculate the percentage of columns (a1, a2, a3) that have a value >= |0.5| and report the percentage that has positive correlation >0.5 and negative correlation <-0.5 separately. thanx in advance! input name a1 a2 a3... (5 Replies)
Discussion started by: quincyjones
5 Replies

9. Shell Programming and Scripting

Calculate Percentage

Hello, Ive got a bunch of numbers here e.g: 6065 6094 6348 6297 6161 6377 6338 6290 How do I find out if there is a difference between 10% or more between one of these numbers ? I am trying to do this in Bash.. but no luck so far.. Does anyone have an Idea ?? Thanx, - Pascal... (9 Replies)
Discussion started by: denbekker
9 Replies

10. Shell Programming and Scripting

Calculate percentage difference between two columns

I have a input text file in this format: ITEM1 10.9 20.1 ITEM2 11.6 12 ITEM3 14 15.7 ITEM5 20 50.6 ITEM6 25 23.6 I want to print those lines which have more than 5% difference between second and third columns. (8 Replies)
Discussion started by: ctrld
8 Replies
cxa(4)							     Kernel Interfaces Manual							    cxa(4)

Name
       cxa - CXA16 communications interface

Syntax
       device dhu0 at uba0 csr 0160440 flags 0xffff vector dhurint dhuxint

Description
       A CXA16 provides 16 data-leads-only communication lines with no modem control.  The CXA16 conforms to RS423A.  The device behaves and looks
       just like a DHV11 (with the exception of modem control and number of lines) and is specified in the configuration line the same as a  DHV11
       device.	 Each line attached to the CXA16 communications multiplexer behaves as described in and can be set to run at any of 16 speeds; see
       for the encoding.

       A flags field of 0xffff must be used to specify that all lines are to operate as hardwired.  This is done to prevent the  line  from  being
       treated as a modem control line.

       The dhu driver normally interrupts on each input character.  The and devices operate under the control of the driver.

Diagnostics
       dhu%d: receive fifo overflow
       The  character input fifo overflowed before it could be serviced.  This can happen if a hard error occurs when the CPU is running with ele-
       vated priority, as the system then prints a message on the console with interrupts disabled.  This can cause a few input characters  to	be
       lost to users.  It is not serious.

       dhu%d:%d DMA ERROR
       A  DMA  transfer  error	has  occurred.	 The unit number and line number are printed.  This means that the channel indicated has failed to
       transfer DMA data within 10.7 microseconds of the bus request being acknowledged or that there is a memory parity error.  This may cause  a
       few output characters to be lost.

       dhu%d: DIAG. FAILURE
       This indicates that the internal diagnostics have detected an error.

       dhu%d: DHU HARDWARE ERROR.  TX.DMA.START failed
       The failed to clear the start bit.  Normally, this is cleared to signal that a DMA transfer has completed.

Files
See Also
       tty(4), MAKEDEV(8)

																	    cxa(4)
All times are GMT -4. The time now is 10:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy