10-31-2008
am using the HP-unix ,does this support this format??
not_equal=12
equal_dat=14
total_dat=18
i tried for equal and not eqaul as well.
For equal..i didn't got any answer
echo "scale=2; equal_dat*100/total_dat" | bc
for not equal i got a an error like
echo "scale=2; not_equal_count.dat*100/total_count.dat" | bc
syntax error on line 1,
Please advice
10 More Discussions You Might Find Interesting
1. Programming
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
Hi, I am having the file which contains the following two columns.
518 _factorial
256 _main
73 _atol
52 ___do_global_ctors
170 ___main
52 ___do_g
How can calculate the percentage of each value in the first column ?
first need to get the sum of the first column and... (3 Replies)
Discussion started by: saleru_raja
3 Replies
3. Shell Programming and Scripting
Hi
I need a awk script to calculate percentage.
I have to pass the pararmeters in to the awk script and calculate the percentage.
Sum = 50
passed = 43
failed = 7
I need to pass these value in to the awk script and calculate the percentage.
Please advice me. (8 Replies)
Discussion started by: bobprabhu
8 Replies
4. UNIX for Dummies Questions & Answers
A short excerpt of my .txt file looks like:
CXRA3Z2J9MQKR B
CXRA3Z2J9MQKR A
CXRA3Z2J9MQKR C
CXRA3Z2J9MQKR B
A162JX4ML69UIC C
A162JX4ML69UIC A
FZ9Z19TI2XOA5 A
FZ9Z19TI2XOA5 C
FZ9Z19TI2XOA5 B
FZ9Z19TI2XOA5 B
BRNTTJUB8GXE9 A
BRNTTJUB8GXE9 A
... (7 Replies)
Discussion started by: pxalpine
7 Replies
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
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
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
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
LEARN ABOUT DEBIAN
xpacmdnew
xpacmdnew(3) SAORD Documentation xpacmdnew(3)
NAME
XPACmdNew - create a new XPA public access point for commands
SYNOPSIS
#include <xpa.h>
XPA XPACmdNew(char *class, char *name);
DESCRIPTION
Create a new XPA public access point for commands that will share a common identifier class:name. Enter this access point into the XPA name
server, so that it can be accessed by external processes. XPACmdNew() returns an XPA struct.
It often is more convenient to have one public access point that can manage a number of commands, rather than having individual access
points for each command. For example, it is easier to command the ds9 image display using:
echo "colormap I8" | xpaset ds9
echo "scale log" | xpaset ds9
echo "file foo.fits" | xpaset ds9
then to use:
echo "I8" | xpaset ds9_colormap
echo "log" | xpaset ds9_scale
echo "foo.fits" | xpaset ds9_file
In the first case, the commands remain the same regardless of the target XPA name. In the second case, the command names must change for
each instance of ds9. That is, if a second instance of ds9 called DS9 were running, it would be commanded either as:
echo "colormap I8" | xpaset DS9
echo "scale log" | xpaset DS9
echo "file foo.fits" | xpaset DS9
or as:
echo "I8" | xpaset DS9_colormap
echo "log" | xpaset DS9_scale
echo "foo.fits" | xpaset DS9_file
Thus, in cases where a program is going to manage many commands, it generally is easier to define them as commands associated with the
XPACmdNew() routine, rather than as separate access points using XPANew().
When XPACmdNew() is called, only the class:name identifier is specified. Each sub-command is subsequently defined using the XPACmdAdd()
routine.
SEE ALSO
See xpa(7) for a list of XPA help pages
version 2.1.14 June 7, 2012 xpacmdnew(3)