Sponsored Content
Top Forums Shell Programming and Scripting To get the time exactly 24hrs from the current time Post 302829843 by mohanalakshmi on Saturday 6th of July 2013 08:59:58 AM
Old 07-06-2013
To get the time exactly 24hrs from the current time

Hi guys,

I am having file which contains below data.
Code:
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-07-05 07:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-07-05 11:40:13     10739022730     1027699274PersonInfoShipTO detailsmissing      FirstName,LastName,
2013-07-05 08:40:13     10739022730     1027699274PersonInfoShipTO detailsmissing      FirstName,LastName,

First column represent the time stamp .My requirement is whenever i run my script it needs to go through the above file and should grep the line in which the time stamp should be between current time and 24hrs.
i.e
If i run the script by July 6 ,2013 10.00 pm ct then output should contains the date from July 5 ,2013 10.00 pm ct to July 6,2013 10.00 pm CT.
My OS version is
Code:
SunOS

Thank u guys.

Last edited by mohanalakshmi; 07-16-2013 at 10:00 AM.. Reason: wrong information
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Substituting variable with current time

Hi all I have a script as follows :- #!/usr/bin/ksh IDT=`date +"%OH%M%S"` while true do echo ${IDT} sleep 1 done I need the time to show me the current runtime value for the time, however this returns the time as at the start of the script. Any ideas. Thanks JH (4 Replies)
Discussion started by: jhansrod
4 Replies

2. Shell Programming and Scripting

getting hour minus the current time

Can some one help me getting last hour of the current time with date command in a script. (7 Replies)
Discussion started by: shehzad_m
7 Replies

3. Shell Programming and Scripting

Getting current time from wolfram.com using python

Hello to all, I am looking of a python script that can fetch date & time from wolfram or any website that gives correct time. 1. Open woflram.com website 2. Search query "time" 3. Search result displays the time. The script has to contact the website with the search query, take that... (5 Replies)
Discussion started by: frozensmilz
5 Replies

4. UNIX for Dummies Questions & Answers

getting the current time in Epoch format

Hi everybody, I want to get the current time in epoch format (in UNIX or Korn Shell) and store it in a variable called currentTime. Any response will be highly appreciated:) Thanks in advance, omoyne:D (8 Replies)
Discussion started by: omoyne
8 Replies

5. AIX

crontab 1 hour off from current time

This is a new one on me. We upgraded a system from AIX 5.3 TL 7 to 6.1 TL 7 yesterday. The app people notified us that their cron jobs weren't running at the right time. So I made a test cron entry and here's what I've found: # crontab -l * * * * * /usr/bin/date > /tmp/test.log 2>&1 # cat... (2 Replies)
Discussion started by: homeyjoe
2 Replies

6. Shell Programming and Scripting

How far is given date from current time?

give a date and time: Jun 12 21:05:16 06-12-2012 21:05:16 2012/06/12 21:05:16 How can i subtract these dates and times from the current date and time and get back the difference in seconds? a one liner like: echo "Jun 12 21:05:16" | some perl/awk programming 90900s (2 Replies)
Discussion started by: SkySmart
2 Replies

7. UNIX for Dummies Questions & Answers

Change time with current year

Hi, How can i change the time below (red font) with the current year? Thank You in advance. hostname 2007-Feb-9 /u100/DEVCO/Patching a.log hostname 2010-Jun-25 /u100/DEVCO/DumpCleaner a.log hostname 2011-Jun-25 /u100/DEVCO/DumpCleaner/sample a.log hostname 23:44-Jun-25... (2 Replies)
Discussion started by: lienyca
2 Replies

8. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

9. Shell Programming and Scripting

Add current date and time

i have file 1.txt asdas|csada|13|03|10|04|23|A1|canberra sdasd|sfdsf|13|04|26|23|28|A1|sydney i want to add today's date and time in the end of each row expected output asdas|csada|13|03|10|04|23|A1|canberra|130430|1358 sdasd|sfdsf|13|04|26|23|28|A1|sydney|130430|1358 todays date... (10 Replies)
Discussion started by: radius
10 Replies

10. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies
BTOOL(1)						      General Commands Manual							  BTOOL(1)

NAME
btool - Barry Project's program to interface with BlackBerry handheld SYNOPSIS
btool [-B busname][-N devname][-a db][-c dn][-C dnattr][-d db [-f file][-F sortkey][-r#][-R#]-D#]][-h][-i charset][-l][-L][-m cmd][-M][-p pin][-P password][-s db -f file][-S][-t][-v][-V][-X][-z][-Z] DESCRIPTION
btool is a program that communicates with a BlackBerry device over USB; there is no intention to support ancient serial-port BlackBerries. Since the protocols used by BlackBerry are not documented by the manufacturer Research In Motion, this program is experimental and you use at own risk. Be sure your device is backed up by another program if it contains important data. OPTIONS
-B busname Specify the USB bus to search for Blackberry devices on. This is the first number displayed in the output from the lsusb command, such as 002. If the busname is numeric on your system, 2 and 002 are equal. See also the -N option, which can be used together with this option to precisely select the device to work with. -a db Delete all records from specified database. This can be used multiple times to clear multiple databases. -c dn Convert address book database to LDIF format, using the specified dn as the baseDN. Sends LDIF output to stdout. -C dnattr Spcify LDIF attribute name to use when building the FQDN in the dn attribute. Defaults to 'cn'. If you modify the mapping with the -m switch, make sure that the new dnattr exists. -d db Load database 'db' FROM device and dump to stdout. Can be used multiple times to fetch more than one database. See the -t option for a list of device databases. -e epp Override endpoint pair detection. 'epp' is a single string separated by a comma, holding the read,write endpoint pair. Example: -e 83,5 Note: Endpoints are specified in hex. Use the same numbers given by the lsusb -v output. You should never need to use this option, as endpoints are autodetected. -f file Filename to write or read handheld data to/from. Used in conjunction with the -d and -s options, respectively. Note: the file for- mat of this file is not backward compatible between devel releases. -F sortkey Sort the -d database output according to the given sortkey. Note that the format of this field is special: 'DBName:field1,field2' It contains no spaces, unless the spaces are part of the name. This option can be used multiple times, to match your -d options. Example: If you used the following command: btool -d 'Address Book' You could use the following sort key to sort by Company name first, with a subsort of last and first names. -F 'Address Book:Company,LastName,FirstName' -i charset Specifies the iconv charset to use for converting international strings. The Blackberry uses the WINDOWS-1252 charset, which is incompatible with the more common code pages used in Linux. The most useful charset to use with this option is UTF-8, and is highly recommended. Any other charset available via 'iconv --list' can be used here too, but may not be successful for some character con- versions. -I Sort records before dumping them to stdout. This uses the default library sorting order, which is specific to each database. -l Lists attached Blackberry devices, and their PIN numbers. -L List Contact field names. Each name represents a contact field that the Barry library recognizes. Use these names with the -m option to adjust the LDIF name to field mapping. -m command Map LDIF name to Contact field, or unmap LDIF name. To map a new or existing LDIF attribute name to a Barry contact field, use the format 'ldif,read,write' where ldif represents the name of the attribute to map, read is the contact field name used to read data from the record, and write is the contact field name used to write data to the record. To unmap an LDIF name, specify the LDIF attribute alone. For example, to map a new LDIF attribute called "strange" to read from FirstName and write to LastName, use: -m strange,FirstName,LastName The -m option can be specified multiple times to create the desired mapping. -M List current LDIF mapping to stdout. -N devname Specify the USB device name. This is the second number displayed in the output from the lsusb command, such as 005. If the device name is numeric on your system, 5 and 005 are equal. See also the -B option. -p pin PIN of device to talk with. Only needed if you have more than one Blackberry connected at once. -P password Simplistic method to specify device password. In a real application, this would be done using a more secure prompt. -s db Save database 'db' TO device from data loaded from -f file. See the -t option for a list of device databases. -S Show list of supported database parsers and builders. Parsers are used when reading data out of the device, and builders are used when writing data to the device. If a parser is supported, but its associated builder is not, that means you cannot change the database programmatically, such as with the -s option. -t Show device's database table. -T db Show record state table for given database. -v Dump verbose protocol data during operation. -V Enable vformat MIME output where available. Address Book gets printed in vCard format, Calendar in vEvent format, Memos in vJour- nal, and Tasks in vTodo, etc. -X Perform a USB reset on the device. Similar to the breset command, and does a virtual "replug" of the device. -z Use non-threaded sockets when communicating with the device. This is the behaviour seen in versions 0.12 and earlier, since threads were not yet supported. This option, along with -Z, are for debugging and testing. -Z Use a threaded socket router when communicating with the device. This is the default for btool. This option, along with -Z, are for debugging and testing. -h, --help Show summary of options. DATABASE COMMAND MODIFIERS
The following options modify the -d command option above, and can be used multiple times for more than one record. -r # Fetch specific record, given a record index number as seen in the -T state table. Can be used multiple times to fetch specific records from a single database. -R # Same as -r, but also clears the record's dirty flags. -D # Delete the specified record using the index number as seen in the -T state table. AUTHOR
btool is part of the Barry project. This manual page was written by Ian Darwin and Chris Frey. SEE ALSO
http://www.netdirect.ca/software/packages/barry Especially the caveats, and the call for developers and others to help with the project. February 3, 2012 BTOOL(1)
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy