Sponsored Content
Full Discussion: About date & time difference
Top Forums Shell Programming and Scripting About date & time difference Post 302420765 by rany1 on Wednesday 12th of May 2010 11:11:22 AM
Old 05-12-2010
Hi Radu,

I executed your perl shell but got the following errors. Do you have an idea why ??

Code:
$ cat temp.sh
perl -MTime::Local -le'
/(....)(..)(..)(..)(..)(..)/g and
push @dt, timelocal $6, $5, $4, $3, $2 - 1, $1 - 1900
for @ARGV;
print $dt[1] - $dt[0] if eof;
' 20100430235830 20100501000200

$ perl temp.sh
Number found where operator expected at temp.sh line 7, near "' 20100430235830"
  (Might be a runaway multi-line '' string starting on line 2)
        (Missing operator before  20100430235830?)
Number found where operator expected at temp.sh line 7, near "20100430235830 20100501000200"
        (Missing operator before  20100501000200?)
syntax error at temp.sh line 2, near "-le"
Execution of temp.sh aborted due to compilation errors.


Regs,

---------- Post updated at 10:11 AM ---------- Previous update was at 10:06 AM ----------

Oh, Sorry , I got it ....

I'm typing perl twice ... I don't know well this language yet ....

Thx a lot for all ....
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Date and time difference

Hi, I am starting a process at 9 pm today and want to exit the process by 5am, the next day. Every day at 9pm the shell script will be invoked by autosys. But how can i monitor in my script for 5 am and stop the process ? there may be a case where the script can start at 4.59 am and... (4 Replies)
Discussion started by: risshanth
4 Replies

2. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

3. Shell Programming and Scripting

Date and time difference

Hi, Below is the backup file name (includes date & time) : exp_trx_tables_18_Oct_2010_10_59_00.dmp Extracted date and time from the file name as below using the below "awk"command: date 18-Oct-2010 and time 10:59:00 echo "$fname" | awk -F"_" '{printf "Records will be restored as on... (1 Reply)
Discussion started by: milink
1 Replies

4. Shell Programming and Scripting

Date and time difference

I have start and finish date in the following format - Start Date: 5/21/2010 9:14:00 AM End Date : 5/24/2010 7:23:00 AM I need to get the time difference in the following format :mm or . Any help would be really appreciated. Thank you! (3 Replies)
Discussion started by: randev
3 Replies

5. UNIX for Dummies Questions & Answers

Date and time difference

Hi, I am trying to use the script as under : echo "Please input the string (APC) in the format (APC=x-yyy-z):" read a for i in m1 m2 m4 m5 m6 do cat /m12/$i/12* | grep -B 1 -A 1 inaccessible | gawk '/'$a'/{print $6,$7,$8,x};{x=$3" "$4}' | awk NF > temp cat /m122/$i/12* | grep -B 1 -A 1... (0 Replies)
Discussion started by: vanand420
0 Replies

6. Shell Programming and Scripting

Date / Time difference in shell script

================================================================================ Request ID GMDCOM TIME GMDRRS TIME COM-RRS ================================================================================ <36812974> Tue Oct 1 13:32:40 2013 Tue Oct 1 20:36:42 2013... (1 Reply)
Discussion started by: ghosh_tanmoy
1 Replies

7. Shell Programming and Scripting

Date / Time difference in shell script

Request ID GMDCOMTM GMDRRSTIME GMDRESTIME <36812986> : : :I want to display the date -time difference in other fields. Above I have given for only 1 record. I want to calculate for all the records. (GMCOMTM - GMDRRSTM) ,(GMDRRSTM-GMDRESTM) and... (5 Replies)
Discussion started by: ghosh_tanmoy
5 Replies

8. Shell Programming and Scripting

Date time difference in UNIX shell script

There are 2 dates, Tue Oct 1 13:40:19 2013 Sun Sept 30 10:26:23 2013 I have multiple dates like the above one. How do I calculate the date time difference and display in another column in Shell script. Please help. (3 Replies)
Discussion started by: tanmoysays
3 Replies

9. AIX

Time Difference between date and date -u

Hi Everyone, We are having an issue with date and date -u in our AIX Systems. We have checked environment variable TZ and /etc/environment and however, we could not rectify the difference. >date Thu Mar 19 22:31:40 IST 2015 >date -u Thu Mar 19 17:01:44 GMT 2015 Any clue... (5 Replies)
Discussion started by: madhav.kunapa
5 Replies

10. UNIX for Beginners Questions & Answers

In HP-UX how to find the date time difference ?

Hello, In HP-UX how to find the date time difference ? Start time: 28-APR-2019 21:36:01 End time : 29-APR-2019 00:36:04 ---------------------- Difference is ---------------------- Much appreciate any pointer or view on this. ... (3 Replies)
Discussion started by: Siva SQL
3 Replies
REDSHIFT(5)							 REDSHIFT.CONF(5)						       REDSHIFT(5)

NAME
redshift.conf - configuration file for redshift and gtk-redshift DESCRIPTION
A configuration file with the name `redshift.conf' can optionally be placed in `~/.config/'. The file has standard INI format. General pro- gram options are placed under the `redshift' header, while options for location providers and adjustment methods are placed under a header with the name of that provider or method. General options are: temp-day = integer Daytime temperature temp-night = integer Night temperature transition = 0 or 1 Disable or enable transitions brightness-day = 0.1-1.0 Screen brightness at daytime brightness-night = 0.1-1.0 Screen brightness at night gamma = R:G:B Gamma adjustment to apply adjustment-method = name Select adjustment method. Options for the adjustment method can be given under the configuration file heading of the same name. location-provider = name Select location provider. Options for the location provider can be given under the configuration file heading of the same name. Options for location providers and adjustment methods can be found in the help output of the providers and methods. EXAMPLE
Example for Copenhagen, Denmark: $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m vidmode -v An example configuration file with the same effect as the above command line: [redshift] temp-day=5700 temp-night=3600 gamma=0.8 adjustment-method=vidmode location-provider=manual AUTHOR
redshift was written by Martin Koelewijn and Jon Lund Steffensen. This manual page was created by Franziska Lichtblau <rhalina@old-forest.org> for the Debian project (and may be used by others). redshift 1.7 June 2012 REDSHIFT(5)
All times are GMT -4. The time now is 06:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy