01-15-2009
Quote:
Originally Posted by
npatwardhan
that is just going to print the values..
It prints the values which are piped to awk where the subtraction is performed.
Quote:
i still need to take the difference..
That's done in awk.
Quote:
is there any way i can round the data values in ARRAY1 and ARRAY2? this way i can get rid of the extra precision and speed up my calculations..
Changing the precision will not affect the speed.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm new at scripting but I thought I was getting pretty good at it. I've hit a snag. I try to use expr to compute a fraction say: expr 3 / 4, and I'm getting zero. I guess it's just truncating to the integer, in this case 0, but I need the decimal 0.75. What can I do to compute this value in... (2 Replies)
Discussion started by: jeriryan87
2 Replies
2. Shell Programming and Scripting
I have a large CSV files (e.g. 2 million records) and am hoping to do one of two things. I have been trying to use awk and sed but am a newbie and can't figure out how to get it to work. Any help you could offer would be greatly appreciated - I'm stuck trying to remove the colon and wildcards in... (6 Replies)
Discussion started by: metronomadic
6 Replies
3. Shell Programming and Scripting
HI
i have following problem,
i need to use split command to split files each should be cca 700 lines but i dont know how to inplement it in the scripts becasuse each time the origin file will be various size ,
any body got any idea
cheers (2 Replies)
Discussion started by: kvok
2 Replies
4. Filesystems, Disks and Memory
I analysed disk performance with blktrace and get some data:
read:
8,3 4 2141 2.882115217 3342 Q R 195732187 + 32
8,3 4 2142 2.882116411 3342 G R 195732187 + 32
8,3 4 2144 2.882117647 3342 I R 195732187 + 32
8,3 4 2145 ... (1 Reply)
Discussion started by: W.C.C
1 Replies
5. Shell Programming and Scripting
Hi,
I have data in the following form:
AB001 10
AB002 9
AB003 9
etc
AB200 5
What I need to do is sum up the second value according to groups of the first, i.e. AB001 to AB030 the total being X, AB031 to AB050 the total being Y etc (there are 5 AB ranges of different sizes). I'm sure... (3 Replies)
Discussion started by: chrissycc
3 Replies
6. Shell Programming and Scripting
Hi all,
Thanks in Advance , i am very new to programming part in script i think using some caluations+ sed command only we can do this process in script.
for exampl:
i have file in that one line is like this
using sed i can replace the date and all but my requirement is
The... (3 Replies)
Discussion started by: anishkumarv
3 Replies
7. Shell Programming and Scripting
Hi,
I need a help with arithmetic calculations in my script. I have two variables: a=17; b=1712
I want to perform ($a/$b)*100 with two decimals in the result.
I tried with following:
res=$((100*a/b))
res=`echo "scale=2; $a / $b" | bc`
But I am not getting the decimal values.... (4 Replies)
Discussion started by: karumudi7
4 Replies
8. Shell Programming and Scripting
I have 2 numbers
xmin = 0.369000018
xmax = 0.569000006
and want to calculate
(xmax- xmin) / 5.0
I have tried using $(( )) but is always giving an error (8 Replies)
Discussion started by: kristinu
8 Replies
9. Shell Programming and Scripting
I am running the below bash loop on all the files of a specific type (highlighted in bold) in a directory. There are 4 awk commands that use the input files to search another and look for a match. The input files range from 27 - 259 and are a list of names. The file that is searched is... (11 Replies)
Discussion started by: cmccabe
11 Replies
10. Shell Programming and Scripting
The below bash will untar each tar.bz2 folder in the directory, then remove the tar.bz2.
Each of the tar.bz2 folders ranges from 40-75GB and currently takes ~2 hours to extract. Is there a way to speed up the extraction process?
I am using a xeon processor with 12 cores. Thank you :).
... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT DEBIAN
printok
MESSAGES(3) libbash messages Library Manual MESSAGES(3)
NAME
messages -- libbash library that implements a set of functions to print standard status messages
SYNOPSIS
printOK [indent]
printFAIL [indent]
printNA [indent]
printATTN [indent]
printWAIT [indent]
DESCRIPTION
General
messages is a collection of functions to print standard status messages - those [ OK ] and [FAIL] messages you see during Linux boot process.
The function list:
printOK Prints a standard [ OK ] message (green)
printFAIL Prints a standard [FAIL] message (red)
printNA Prints a standard [ N/A] message (yellow)
printATTN Prints a standard [ATTN] message (yellow)
printWAIT Prints a standard [WAIT] message (yellow)
Detailed interface description follows.
indent
Column to move to before printing.
Default indent is calculated as TTY_WIDTH-10. If current tty width can not be determined (for example, in case of serial console), it
defaults to 80, so default indent is 80-10=10
FUNCTIONS DESCRIPTIONS
printOK [indent]
Prints a standard [ OK ] message (green)
printFAIL [indent]
Prints a standard [FAIL] message (red)
printNA [indent]
Prints a standard [ N/A] message (yellow)
printATTN [indent]
Prints a standard [ATTN] message (yellow)
printWAIT [indent]
Prints a standard [WAIT] message (yellow)
EXAMPLES
Run a program named MyProg, and report it's success or failure:
echo -n 'Running MyProg...'
printWAIT
if MyProg ; then
printOK
else
printFAIL
fi
AUTHORS
Hai Zaar <haizaar@haizaar.com>
Gil Ran <gil@ran4.net>
SEE ALSO
ldbash(1), libbash(1)
Linux Epoch Linux