Hi all,
I have in one script something like this:
FIRSTOCC=`grep -n ORA- alert_bill2.log |tail -"$ROWS"|head -1|cut -d: -f1`
TOTAL=`more alert*|wc -l`
DIFFERENCE=`$TOTAL-$FIRSTOCC`
echo Total lines in alert_bill = $TOTAL
echo $DIFFERENCE
How do I make this substraction work?
Thk (2 Replies)
Hi all,
I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date.
So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
hello
i have obtained the current date ..
current_date=date "+%m/%d%y"
and i have another date ,stored in my log file which i have already retrieved. i want to store the subtraction in a varible called diff.
diff=log_date - currentdate
ex: log_date=01/28/11
current_date=... (3 Replies)
Dear all,
I have 2 questions.
I have a file with many rows which has date of the format YYYYMMDD.
1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too.
2. After converting the date to... (10 Replies)
Hello friends,
I am new on linux, i am facing issues on below script.
#!/bin/sh
current=1355147377
echo $current
last_modified=1354537347
echo $last_modified
DIFF='expr ($current - $last_modified)'
echo $DIFF
Please view this code tag video for how to use code tags when posting... (8 Replies)
i try to set linux date & time in specific format but it keep giving me error
Example :
date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
or
date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
keep giving me this error :
date: invalid date ‘19-01-2017 00:05:01'
Please use CODE tags... (7 Replies)
Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt .
I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies
LEARN ABOUT SUSE
time::localtime
Time::localtime(3pm) Perl Programmers Reference Guide Time::localtime(3pm)NAME
Time::localtime - by-name interface to Perl's built-in localtime() function
SYNOPSIS
use Time::localtime;
printf "Year is %d
", localtime->year() + 1900;
$now = ctime();
use Time::localtime;
use File::stat;
$date_string = ctime(stat($file)->mtime);
DESCRIPTION
This module's default exports override the core localtime() function, replacing it with a version that returns "Time::tm" objects. This
object has methods that return the similarly named structure field name from the C's tm structure from time.h; namely sec, min, hour, mday,
mon, year, wday, yday, and isdst.
You may also import all the structure fields directly into your namespace as regular variables using the :FIELDS import tag. (Note that
this still overrides your core functions.) Access these fields as variables named with a preceding "tm_" in front their method names.
Thus, "$tm_obj->mday()" corresponds to $tm_mday if you import the fields.
The ctime() function provides a way of getting at the scalar sense of the original CORE::localtime() function.
To access this functionality without the core overrides, pass the "use" an empty import list, and then access function functions with their
full qualified names. On the other hand, the built-ins are still available via the "CORE::" pseudo-package.
NOTE
While this class is currently implemented using the Class::Struct module to build a struct-like class, you shouldn't rely upon this.
AUTHOR
Tom Christiansen
perl v5.12.1 2010-04-26 Time::localtime(3pm)