11-28-2001
time arithmetic
Can anyone help please. I am writing a kourne shell script and I am unsure how to do the following:
I have extracted a time string from a logfile, and I have another time string I want to compare it to to see if it's later than the time I'm comparing with.
i.e. expectedSLA="23:00:00", actualDeliveryTime="22:40:00"
I try to do the following:
missedSLA="N"
if [ $actualDeliveryTime > $expectedSLA ]
then
missedSLA="Y"
fi
This always sets missedSLA to "Y". Isn't it supposed to compare using the decimal values of the string? How can I get the above process to work? What can I do? Any help would be greatly appreciated.
Many thanks,
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i am used to making scripts for hp-ux. but lately i tried to make some for solaris. the problem is that when i tried to execute it it gave me an error the "let: not found". why is that? how can i perform an arithmetic function in the solaris shell script?
thanks :) (2 Replies)
Discussion started by: inquirer
2 Replies
2. UNIX for Dummies Questions & Answers
I am a beginner and I have been searching the web all morning for this answer but can't find it anywhere.
I know that
prtint 1*2
will return
1*2
what if i actually want the problem to be calculated
so i want
print 1*2
to return
2
How is this done? (3 Replies)
Discussion started by: tygun
3 Replies
3. Shell Programming and Scripting
Helloo..
I am trying one very simple thing I could not find anything on google..
I have 2 integer variable..and I need to do division...in ksh
where $catch and $num are integer variable..
I tryed with this:
printf "%0.2f" $final=$catch/$num
but it does not work..
any help is... (12 Replies)
Discussion started by: amon
12 Replies
4. Shell Programming and Scripting
Yes I know tcsh sucks for scripting and arithmetic but I have to write a script for multiple users and they all use tcsh.
I have this variable that I 'set' with but pulling numbers off of stings with
set STUFF = `grep string file | awk command`
Now I would like to add up the numbers that... (4 Replies)
Discussion started by: gobi
4 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a list of 'inputs' and i want to convert those on the second list named 'Desired Outputs', but i don't know how to do it?
Inputs Desired Outputs
1 2
94 4
276 8
369 10
464 12 ... (0 Replies)
Discussion started by: filda
0 Replies
6. UNIX for Dummies Questions & Answers
Hello all,
I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns.
What I want to do is to to sum the values in each row & column in every file.
The following explains what I want to do;
... (9 Replies)
Discussion started by: Muhammad Rahiz
9 Replies
7. Shell Programming and Scripting
Hello,
Could someone explain how this one is possible:
# @ x = 10 - 11 + 3
# echo $x
-4
I know that writing script using csh is bad idea, but I need to write few lines.
thanks
Vilius (2 Replies)
Discussion started by: vilius
2 Replies
8. Shell Programming and Scripting
Hi,
I need to process a file which contains below data. Usually the files contains both Start and Finish time. but for Few records, it contains only Start. For those records I need to add the finish line by adding 5 minutes to Start time.
Started BBIDX Tue Jun 1 15:15:11 EDT 2010 292308... (1 Reply)
Discussion started by: siba.s.nayak
1 Replies
9. Shell Programming and Scripting
Hello fellow forum members,
I wrote below piece of code to calculate the date after a given date -
date=$DATE_FINAL
declare -a max_month=(0 31 28 31 30 31 30 31 31 30 31 30 31)
eval $(echo $date|sed 's!\(....\)\(..\)\(..\)!year=\1;month=\2;day=\3!')
(( year4=year%4 ))
(( year100=year%100... (9 Replies)
Discussion started by: ektubbe
9 Replies
10. Shell Programming and Scripting
I need to divide the number of white spaces by total number of characters in a file using bash. I am able to get the number of white spaces correctly using:
tr -cd < afile | wc -c
I am also able to get the total number of characters using:
wc -c afile
How do I divide the first... (2 Replies)
Discussion started by: ngabrani
2 Replies
LEARN ABOUT DEBIAN
diffpdf
DIFFPDF(1) General Commands Manual DIFFPDF(1)
NAME
diffpdf - compare two PDF files textually or visually
SYNOPSIS
diffpdf [file1] [file2]
DESCRIPTION
This manual page very briefly documents the diffpdf command. (Click the GUI's Help button or press F1 for more information.)
DiffPDF is a GUI application used to compare two PDF files.
By default the comparison is of the words on each pair of pages, but comparing character by character is also supported (e.g., for logo-
graphic languages). And there's also support for comparing the pages by appearance (for example, if a diagram is changed or if a paragraph
is reformatted, or a font changed). It is also possible to compare particular pages or page ranges. For example, if there are two versions
of a PDF file, one with pages 1-12 and the other with pages 1-13 because of an extra page having been added as page 4, they can be compared
by specifying two page ranges, 1-12 for the first and 1-3, 5-13 for the second. This will make DiffPDF compare pages in the pairs (1, 1),
(2, 2), (3, 3), (4, 5), (5, 6), and so on, to (12, 13).
If the program is passed two PDF filenames on the command line it will start up and compare those files in Text mode (or in Appearance mode
if the filenames are preceded by -a or --appearance).
SEE ALSO
For a command line tool for comparing PDF files see http://www.qtrac.eu/comparepdf.html.
AUTHOR
diffpdf was written by Mark Summerfield <mark@qtrac.eu>.
This manual page was written by Mark Summerfield <mark@qtrac.eu> and David Paleino <dapal@debian.org>, for the Debian project (and may be
used by others).
diffpdf v2.1.1 2012-06-04 DIFFPDF(1)