11-21-2009
On a busy machine, the difference will be magnified.
In a script where it is called many times, there will be a big difference. When combined with other inefficient code (e.g., unnecessary external commands), the difference is magnified even more.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: cin2000
2 Replies
2. Shell Programming and Scripting
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)
Discussion started by: lyoncc
4 Replies
3. Shell Programming and Scripting
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)
Discussion started by: Grizzly
3 Replies
4. Shell Programming and Scripting
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)
Discussion started by: yoursdivu
2 Replies
5. Shell Programming and Scripting
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)
Discussion started by: itsvikas
3 Replies
6. Shell Programming and Scripting
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)
Discussion started by: rmkganesh
3 Replies
7. Shell Programming and Scripting
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)
Discussion started by: Adithya Gokhale
7 Replies
8. Shell Programming and Scripting
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)
Discussion started by: Board27
1 Replies
9. UNIX for Beginners Questions & Answers
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)
Discussion started by: echo manolis
7 Replies
10. UNIX for Advanced & Expert Users
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 DEBIAN
pdf::api2::nameddestination
PDF::API2::NamedDestination(3pm) User Contributed Perl Documentation PDF::API2::NamedDestination(3pm)
NAME
PDF::API2::NamedDestination - PDF::API2 named destination support
METHODS
$dest = PDF::API2::NamedDestination->new $pdf
$dest = PDF::API2::NamedDestination->new_api $api
Returns a destination object. This method is different from 'new' that it needs an PDF::API2-object rather than a
PDF::API2::PDF::File-object.
$dest->link $page, %opts
Defines the destination as launch-page with page $page and options %opts (-rect, -border or 'dest-options').
$dest->url $url, %opts
Defines the destination as launch-url with url $url and options %opts (-rect and/or -border).
$dest->file $file, %opts
Defines the destination as launch-file with filepath $file and options %opts (-rect and/or -border).
$dest->pdfile $pdfile, $pagenum, %opts
Defines the destination as pdf-file with filepath $pdfile, $pagenum and options %opts (same as dest).
$dest->dest( $page, -fit => 1 )
Display the page designated by page, with its contents magnified just enough to fit the entire page within the window both horizontally
and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the
page within the window in the other dimension.
$dest->dest( $page, -fith => $top )
Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the
page magnified just enough to fit the entire width of the page within the window.
$dest->dest( $page, -fitv => $left )
Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of
the page magnified just enough to fit the entire height of the page within the window.
$dest->dest( $page, -fitr => [ $left, $bottom, $right, $top ] )
Display the page designated by page, with its contents magnified just enough to fit the rectangle specified by the coordinates left,
bottom, right, and top entirely within the window both horizontally and vertically. If the required horizontal and vertical
magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension.
$dest->dest( $page, -fitb => 1 )
(PDF 1.1) Display the page designated by page, with its contents magnified just enough to fit its bounding box entirely within the
window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller
of the two, centering the bounding box within the window in the other dimension.
$dest->dest( $page, -fitbh => $top )
(PDF 1.1) Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the
contents of the page magnified just enough to fit the entire width of its bounding box within the window.
$dest->dest( $page, -fitbv => $left )
(PDF 1.1) Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the
contents of the page magnified just enough to fit the entire height of its bounding box within the window.
$dest->dest( $page, -xyz => [ $left, $top, $zoom ] )
Display the page designated by page, with the coordinates (left, top) positioned at the top-left corner of the window and the contents
of the page magnified by the factor zoom. A zero(0) value for any of the parameters left, top, or zoom specifies that the current
value of that parameter is to be retained unchanged.
AUTHOR
Alfred Reibenschuh
perl v5.14.2 2014-03-09 PDF::API2::NamedDestination(3pm)