Sponsored Content
Top Forums Shell Programming and Scripting Date not correct so it changed to current date. Post 303010305 by RudiC on Friday 29th of December 2017 11:54:07 AM
Old 12-29-2017
Not sure I fully understand what you're doing and what you're after, but a few comments:

Why do you use (convert to) date formats like Mon Oct 27 18:00:01 CET 2014 when the date/time part of your file names is YYYY-MM-DD_HH.mm.ss, i.e. totally different?

info date:
Quote:
The output of the ‘date’ command is not always acceptable as a date string, not only because of the language problem, but also because there is no standard meaning for time zone items like ‘IST’. When using ‘date’ to generate a date string intended to be parsed later, specify a date format that is independent of language and that does not use time zone items other than ‘UTC’ and ‘Z’.
Why do you convert "_" chars to " " and "." to ":" if you dont use those afterwards?

Why do you specify the time stamps down to the second but iterate the loop in one minute steps only?

Would it be feasible to do all the looping, calculating etc. on seconds since epoque, and then convert those to a time string for the comparison / grepping? Would it make sense to forgo the seconds when grepping?

And, in lieu of the sed invocation in inputDateFmt, did you consider bash's "Parameter Expansion: Pattern substitution"?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Extracting date from file name and comparing with current date

I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date. $file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z really appreciate any help. thanks mkneni (4 Replies)
Discussion started by: MKNENI
4 Replies

2. Shell Programming and Scripting

Date One Week Ago From Given Date, Not From Current Date

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)
Discussion started by: Donkey25
4 Replies

3. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

4. Shell Programming and Scripting

csv file field needs to be changed current system date with awk

HI, I have csv file with records as shown below. 4102,Bangalore,G10,21,08/17/2011 09:28:33:188,99,08/17/2011 09:27:33:881,08/17/2011... (1 Reply)
Discussion started by: raghavendra.nsn
1 Replies

5. Shell Programming and Scripting

Fetch date of 7 years back from current date in Perl

$beginDate = substr(DateCalc("today", "-7Days"),0,8); This fetches the date 7 days back Can I fetch the date before 7 years from todays date in Perl using same syntax Use code tags, see PM. (3 Replies)
Discussion started by: parthmittal2007
3 Replies

6. UNIX for Dummies Questions & Answers

Adding hours and minutes to current date (Only to date not to time)

Hi, I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help. Thanks! (4 Replies)
Discussion started by: manojgarg
4 Replies

7. HP-UX

awk command in hp UNIX subtract 30 days automatically from current date without date illegal option

current date command runs well awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat subtract 30 days fails awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies

8. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

9. Linux

How to calculate the quarter end date according to the current date in shell script?

Hi, My question is how to calculate the quarter end date according to the current date in shell script? (2 Replies)
Discussion started by: Divya_1234
2 Replies

10. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies
pilot-foto(1)							    PILOT-LINK							     pilot-foto(1)

NAME
pilot-foto - Palm 'Foto' Image Installer/Remover/Fetcher/Converter SECTION
pilot-link: Userland conduits SYNOPSIS
pilot-foto [-p|--port <port>] [--version] [-?|--help] [-q|--quiet] [--usage] [-d|--delete] [--delete-all] [-i|--install] [-l|--list] [-f|--fetch] [-F|--fetch-all] [-c|--convert] DESCRIPTION
This is a palm conduit to fetch, install, or remove, Foto files from a Palm. It can also convert *.jpg.pdb files that have already been fetched from the Palm to jpeg files. Delete all, or named fotos from handheld. Install one, or many jpeg images to handheld. List all jpeg files and thumbnails on handheld. Fetch all jpeg files, or certain ones by name. Tries to detect if a file really is a jpeg and refuses to install it, if it is not. pilot-foto allows you to do multiple operations in one sync. For instance, delete test.jpg and install test.jpg. USAGE
pilot-foto -p <port> [options] file OPTIONS
pilot-foto options -d, --delete Delete a jpg file on the handheld --delete-all Delete ALL jpg files on the handheld -i, --install Install a jpg file -l, --list List all photos and thumbnails -f, --fetch Fetch files from the Palm -F, --fetch-all Fetch ALL jpg files from the Palm -c, --convert convert [file].jpg.pdb files to jpg Conduit Options -p, --port port Use device file port to communicate with the Palm handheld. If this is not specified, pilot-foto will look for the $PILOTPORT environment variable. If neither are found or supplied, pilot-foto will print the usage information. -q, --quiet Suppress 'Hit HotSync button' message -v, --version Display version of pilot-foto and exit without connecting. Help Options -h, --help Display the help synopsis for pilot-foto and exit without connecting. --usage Display a brief usage message and exit without connecting. EXAMPLES
Examples: pilot-foto -p /dev/pilot -f pilot-foto -d MyImage.jpg pilot-foto -i MyImage.jpg pilot-foto -i *.jpg pilot-foto -f MyImage pilot-foto -c MyImage.jpg.pdb PROBLEMS
Palm has not published their database format for the thumbnails. So, pilot-foto puts a generic penguin thumbnail for every image uploaded. Fotos can be accessed by a named list on the handheld as well as the thumbnails. This has been tried on a couple of handhelds. It is possi- ble that a foreign palm or different model will not like it. To get a thumbnail image you can copy the jpegs to the memory card. If you copy them back to the handheld they will have a new thumbnail that matches the jpeg. AUTHOR
This manual page was converted to XML by Neil Williams <linux@codehelp.co.uk> BUGS
If a jpeg is installed with the same name as one already on the palm you will have 2 thumbnails pointing to the same jpeg. The new jpeg will overwrite the old jpeg. If the thumbnail fails to install then the jpeg should be removed. It is not. We have an online bug tracker. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed. Reporting bugs via email, while easy, is not very useful in terms of accountability. Please point your browser to http://bugs.pilot-link.org: http://bugs.pilot-link.org and report your bugs and issues there. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. SEE ALSO
pilot-link(7) 0.12.5 Copyright 1996-2007 FSF pilot-foto(1)
All times are GMT -4. The time now is 08:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy