I'm no expert with awk, but here's something i'd like to share:
While i do agree that one-liners are cool, there are occasions it just makes no sense.
Saying, a well formated code is easier to read - and find issues/improvements, than within a one liner of that length. (me have FHD (1920x1080) display, and i need to scroll sideways)
This said, you might want to use a function (rather than an if-block) to transform time and date to seconds and to avoid things like:
For which you could have just written +0.
Once you transformed the date+time to seconds, you simply subtract the one from the other and get the difference.
I need to get the next day's date of the user entered date
for example:
Enter date (yyyy/mm/yy):
2013/10/08I need to get the next day's date of the user entered date
Desired Output:
2013/10/09Though there are ways to achieve this is Linux or Unix environment (date command) ,I need to... (1 Reply)
Hi,
I have a folder structure as follows,
DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt
-> 01 -> ABC_2012-01-03_01.txt
-> 02 -> ABC_2012-01-03_02.txt
...
-> 23 -> ABC_2012-01-03_02.txt
-> 2012-01-02
-> 2012-01-03
So the dir DATA contains the above hierarchy,
User input Start and... (6 Replies)
Could you “crontab” it to run every 10 minutes on work days (Mo - Fr) between 08:00 and 18:00
i know to run every 10 mints but can any one guide me how to achieve the above one (2 Replies)
Hi guys,
I had a scenario...
1. I had to get the previous days date in yyyymmdd format
2. i had to create a file with Date inthe format yyyymmdd.txt format
both are different
thanks guys in advance.. (4 Replies)
can some one show me how to generate last hour of date for example:
2012010100 -> 2011123123 // check first date of a new year
2008030100 -> 2008022923 // check leap year as well
And also no perl code is restricted.
This is what i am facing issue now, can someone provides help to me. (4 Replies)
Hello,
I've created the script below to compare the content of two files with a delay of an hour. After an hour, the lines that exist in both files, will be printed and executed.
The script now uses a counter to countdown 50 minutes. But what I would prefer is to check the file timestamp of... (3 Replies)
Hi,
Can someone guide me to write a unix script for getting a hour out of a date command and validating hour to see if its > 7 and < 16. if hours is >7 and <16 then assign a variable value of 0730 and if hour is >16 then assign a variable value of 1630?
Help appreciated.
Thanks in advance.... (9 Replies)