07-28-2007
Quote:
Originally Posted by
fwabbly
thanks. its always the little things!
What little thing solved it for you? Your original line and all of the alternatives posted should work in ksh.
You would not have got the error message you gave with the line you posted if it was run in a POSIX shell (ksh, bash, etc.)
One alternative posted, EXPHOURINSEC=$((EXPDATEHOUR * 3600)), while a valid POSIX command, would not have worked in /bin/sh on a *BSD system.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have no idea about programming, just know some simple html :confused:and I need to get to somebody that can help me with creating the application (?) that will multiply 2 varibales and given price (height x lenght) x $$$.
PLEASE HELP!:confused:
edit by bakunin: Anita, as much as we... (2 Replies)
Discussion started by: Anita Flejter
2 Replies
2. Shell Programming and Scripting
All I want to do is find 5!.
read num
num={1..5}
while
do
f=
done
echo f
Error Msg. line 5: ${1..5} bad substitution
line 6: integer expression expected
Line 5 is the num=...
Line 6 is the "while" statement
I am new at this, and I am really, really trying.
Please... (14 Replies)
Discussion started by: Ccccc
14 Replies
3. Shell Programming and Scripting
Hi,
I need to multiply 3rd column (comma seperated) of entire file by a value say 2.2.
Suppose the file is:
C,Gas $ YTD(TRI),15512.36,01/01/2010
New file should be (3rd column value multiplied by 2.2):
C,Gas $ YTD(TRI),34127.192,01/01/2010 (5 Replies)
Discussion started by: yale_work
5 Replies
4. Shell Programming and Scripting
Hi All,
I have tried few things with this but it did not help much.
I have some 200,000 files in a directory. There are two sets of files.
1. Files with extension .dat with file names like these (1.dat, 2.dat, 5.dat, 8.dat....200000.dat)
2. Another set of files with .txt extension and... (5 Replies)
Discussion started by: shoaibjameel123
5 Replies
5. UNIX for Dummies Questions & Answers
I have multiply directories scattered throughout my system that end in 2011.
Example:
one_2011
two_2011
three_2011
etc....
I'm trying to find all of these directories but coming up short.
I tried
find / -type d -name *2011 > example
Any suggestions? I already searched in the... (13 Replies)
Discussion started by: shorty
13 Replies
6. UNIX for Dummies Questions & Answers
Hello,
How can I multiply two variables that contain floating point numbers.
For example, how can I get the value for c
a=2.165
b=3.234
c=a+3*b
Thanks,
Guss (1 Reply)
Discussion started by: Gussifinknottle
1 Replies
7. Shell Programming and Scripting
HI help
i have
cc 9+37.50 328611.50 688498.25 42.38
cc 66+62.50 328636.50 688498.42 42.58
i want to make o/p
cc 9+3750 328611.50 688498.25 42.38
cc 66+6250 328636.50 688498.42 42.58
plz help (2 Replies)
Discussion started by: Indra2011
2 Replies
8. Shell Programming and Scripting
Hi experts,
I want to multiply certain columns to variable,
data :
1 2 3 4 5 6 7 8 9
result with var = 2 for column 3,6,9 ... (every columns which can be divided to 3):
1 2 6 4 5 12 7 8 18
I have tried :
awk 'BEGIN{FS=OFS=" "}{print $1,$2,$3*a,$4,$5,$6*a,$7,$8,$9*2 }' a=2 file.txt
but how... (6 Replies)
Discussion started by: guns
6 Replies
9. Shell Programming and Scripting
I have a file that reports the size of disks GB's or TB's - I need the file to report everything in MB's. Here is an extract of the file - the last column is the disk size.
19BC 2363 20G
1AA3 2363 2.93T
1A94 2363 750G
Whenever I come across a G I want to delete the G and multiply by... (2 Replies)
Discussion started by: kieranfoley
2 Replies
10. UNIX for Dummies Questions & Answers
Hi
I would like to know how can I multiply the value of column three to columns 4-end of file
example of input file:
rs1000012 AK8 2 0.05 0.05 1 0 0
rs10000154 PAQR3 0.01 2 1 2 2 1
Desired output file:
rs1000012 AK8 ... (1 Reply)
Discussion started by: fadista
1 Replies
FMA(3) BSD Library Functions Manual FMA(3)
NAME
fma, fmaf, fmal -- fused multiply-add
LIBRARY
Math Library (libm, -lm)
SYNOPSIS
#include <math.h>
double
fma(double x, double y, double z);
float
fmaf(float x, float y, float z);
long double
fmal(long double x, long double y, long double z);
DESCRIPTION
The fma(), fmaf(), and fmal() functions return (x * y) + z, computed with only one rounding error. Using the ordinary multiplication and
addition operators, by contrast, results in two roundings: one for the intermediate product and one for the final result.
For instance, the expression 1.2e100 * 2.0e208 - 1.4e308 produces infinity due to overflow in the intermediate product, whereas fma(1.2e100,
2.0e208, -1.4e308) returns approximately 1.0e308.
The fused multiply-add operation is often used to improve the accuracy of calculations such as dot products. It may also be used to improve
performance on machines that implement it natively. The macros FP_FAST_FMA, FP_FAST_FMAF and FP_FAST_FMAL may be defined in <math.h> to
indicate that fma(), fmaf(), and fmal() (respectively) have comparable or faster speed than a multiply operation followed by an add opera-
tion.
IMPLEMENTATION NOTES
In general, these routines will behave as one would expect if x * y + z were computed with unbounded precision and range, then rounded to the
precision of the return type. However, on some platforms, if z is NaN, these functions may not raise an exception even when the computation
of x * y would have otherwise generated an invalid exception.
SEE ALSO
fenv(3), math(3)
STANDARDS
The fma(), fmaf(), and fmal() functions conform to ISO/IEC 9899:1999 (``ISO C99''). A fused multiply-add operation with virtually identical
characteristics appears in IEEE draft standard 754R.
HISTORY
The fma() and fmaf() routines first appeared in FreeBSD 5.4, and fmal() appeared in FreeBSD 6.0.
BSD
January 22, 2005 BSD