Bash I am not surprised since I gather that is not a happy marriage with Solaris (is it even installed on your system?). However the problem with posix compliant version puzzles me. What is the output of this command on your system:
Hi,
I have input with decimal point ( 9.99 ) for hours variable hrs.
I need to change it to seconds.
Here is my code:
secs=`/usr/ucb/echo $hrs*3600 |bc`
But I don't want to see the decimal point.
I can use awk to trim it if there is one.
I am just wondering if there is better standard... (2 Replies)
Hi all. Using /bin/sh on an HPUX system.
I want to place a decimal in the field 2 charactors from the right (yes, converting to currency). The field lengths are variable. Here's what I'm doing:
exec < filename
while read FIELD1 FIELD2
do
FIELD1="echo $FIELD1 | sed 'syntax that will... (4 Replies)
Im trying to compare two numbers with decimals but its not working as expected.
a=1
b=1.1
if
then echo "equal"
fi
When I do this it says that the numbers are equal. Ultimately Im using -le and -ge in the if statements but I tested with -eq for simplicity.
Any way to make this... (3 Replies)
Hi
In Unix, I have a file with some numbers like :
45600
12345
I want to insert a decimal point for these numbers based on user input.
If the input is 2, the numbers should be changed to
456.00
123.45
If the input is 3, the numbers should be changed to
45.600
12.345
Can... (2 Replies)
For numbers between 0 and 1 the below logic is not working.
Output of above shall be "correct" but its echoing "incorrect".Kindly suggest
a=.1
if
then
echo correct
else echo incorrect
fi
Video tutorial on how to use code tags in The UNIX and Linux Forums. (3 Replies)
Hi All,
Can some one help me in identifying the significance of character "$" ,Which is playing critical role in matching decimal point numbers as below.
$ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?$/) print}'
$ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?/) print}'
01#.01
$
Regards,
Rmkganesh. (3 Replies)
Hello,
I am having a problem when i execute following script on RHEL 6.4. Same script works fine on another machine where I have same version of RHEL and KSH.
Below is the rpm and RHEL version.
ossvm12(0)> rpm -qa | grep ksh
ksh-20100621-19.el6.x86_64
ossvm12(0)> cat... (7 Replies)
Hi,
i need to move the decimal point from a file listing some numbers like this :
49899.50
49914.55
49894.48
49939.65
49879.44
49919.57
49934.62
49944.67
49954.72 (1 Reply)
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
Hi , I have a file which contains text like
A|Mau|Code|12|Detail
B|Mau|Code|20|Header
I want to write a command using awk which will output
A|Mau|Code|12.00|Detail
B|Mau|Code|20.00|Header
I used a command like awk -F"|" {printf "%s|%s|%s|%.2f|%s",$1,$2,$3,$4,$5}' which does the... (4 Replies)
Discussion started by: LoneRanger
4 Replies
LEARN ABOUT HPUX
hppacaddd
hppac(3X)hppac(3X)NAME
hppac: HPPACADDD(), HPPACCMPD(), HPPACCVAD(), HPPACCVBD(), HPPACCVDA(), HPPACCVDB(), HPPACDIVD(), HPPACLONGDIVD(), HPPACMPYD(), HPPAC-
NSLD(), HPPACSLD(), HPPACSRD(), HPPACSUBD() - HP 3000-mode packed-decimal library
SYNOPSIS DESCRIPTION
This set of calls invokes the library functions for emulating 3000-mode (MPE V/E) packed-decimal operations. These functions are in
library which is searched when the option is used with or ld(1).
Performs packed-decimal addition.
Compares two packed-decimal numbers.
Converts an ASCII representation to packed-decimal.
Converts a binary representation to packed-decimal.
Converts a packed-decimal number to ASCII.
Converts a packed-decimal number to binary.
Performs packed-decimal division.
Performs packed-decimal division (alternate routine).
Performs packed-decimal multiplication.
Performs a packed-decimal normalizing left shift.
Performs a packed-decimal left shift.
Performs a packed-decimal right shift.
Performs packed-decimal subtraction.
For all operations, the value returned in the variable to which the compcode argument points is one of the following values of type
Result > 0 or operand1 > operand2
Result < 0 or operand1 < operand2
Result == 0 or operand1 == operand2
For all operations, the value returned in the variable to which the pacstatus argument points is one of the following values of type Their
meanings are intended to be obvious:
AUTHOR
The HPPAC library was developed by HP.
SEE ALSO
PA-RISC Systems Only hppac(3X)