10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So basically I have a log file and each line in this log file starts with a timestamp:
MON DD HH:MM:SS
SEP 15 07:30:01
I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies
2. Shell Programming and Scripting
Hi, im trying to write a grep script that returns me the last inputs added in the last hour in the log file. Literally i have nothing yet but:
grep 'Line im looking for' LOGFILE.log | tail -1
this only gives me the last input, but no necessarily from the last hour.
Help Please. (4 Replies)
Discussion started by: blacksteel1988
4 Replies
3. Shell Programming and Scripting
Hi guys
I want any script to get me next hour
For example
Nexthour.sh 2013022823
It get me result
2013030100
Thanks a lot , I'm using Solaris 10 (5 Replies)
Discussion started by: teefa
5 Replies
4. Shell Programming and Scripting
Hi friends, I want to convert 24 hour timing to 12 hour please help me...
my data file looks like this..
13-Nov-2011 13:27:36 15.32044 72.68502
13-Nov-2011 12:08:31 15.31291 72.69807
16-Nov-2011 01:16:54 15.30844 72.74028
15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies
5. UNIX for Advanced & Expert Users
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
... (1 Reply)
Discussion started by: mihirvora16
1 Replies
6. Shell Programming and Scripting
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)
Discussion started by: mihirvora16
6 Replies
7. Shell Programming and Scripting
Hi,
I am trying to grep a particular string from the files of 2 different servers without copying and calculate the total count of its occurence on both files.
File structure is same on both servers and for reference as follows:
27-Aug-2010... (4 Replies)
Discussion started by: poweroflinux
4 Replies
8. Shell Programming and Scripting
Hi,
My log file is something like this.
(08/04/2009 00:27:42.179)(:) aaaaaaaaaaaa
(08/04/2009 00:27:42.181)(:) bbbbbbbbbbbbbbbb
(08/04/2009 01:00:42.713)(:) cd cdc d ddddsksjdkssksksj
(08/04/2009 01:02:42.716)(:) raarrarararararara
(08/04/2009 01:07:43.036)(:ERROR) Port... (8 Replies)
Discussion started by: rdhanek
8 Replies
9. UNIX for Dummies Questions & Answers
My program:
__________________________________
#!/bin/ksh
DAY=`date +%y%m%d`
H=`date +%H`
M=`date +%M`
day=`date +%m/%d/%y`
let h=$H-1
echo DAY $DAY
echo H $H
echo M $M
echo day $day
echo h $h
_____________________________________
My result: (3 Replies)
Discussion started by: bobo
3 Replies
10. UNIX for Dummies Questions & Answers
set DAY=`date +%y%m%d`
set H=`date +%H`
set M=`date +%M`
mailx -s "$H-Mydata" myemail@mail.com<mydata
I am looking to set the current hour to have 1 hour less in the subject header:
For example: let's say the system time is 8
I want to have "7-Mydata" not "8-Mydata"
Can some1... (6 Replies)
Discussion started by: bobo
6 Replies
CHEWMAIL(1) User Contributed Perl Documentation CHEWMAIL(1)
NAME
chewmail - mail archiver
SYNOPSIS
chewmail [OPTIONS] <MAILBOX> ...
DESCRIPTION
chewmail is a program for archiving mail. It is inspired by the by the Python-based archivemail, but with more useful semantics. All mail
is archived to the mailbox specified with the --output-box switch, in mbox format. It can read mailboxes in mbox, Maildir and MH formats.
Internally, chewmail uses Mail::Box, so it support file names and URLs supported by that module.
OPTIONS
-o mailbox-format, --output-box=mailbox-format
The mailbox to archive messages to. The mailbox is run through the Date::Format module, so it supports all it's conversion specifiers.
The date and time is relative to the messages timestamp, or the current time if the timestamp is impossible to determine. A sample of
the conversion specifiers follows:
%% PERCENT
%b month abbr
%B month
%d numeric day of the month, with leading zeros (eg 01..31)
%e numeric day of the month, without leading zeros (eg 1..31)
%D MM/DD/YY
%G GPS week number (weeks since January 6, 1980)
%h month abbr
%H hour, 24 hour clock, leading 0's)
%I hour, 12 hour clock, leading 0's)
%j day of the year
%k hour
%l hour, 12 hour clock
%L month number, starting with 1
%m month number, starting with 01
%n NEWLINE
%o ornate day of month -- "1st", "2nd", "25th", etc.
%t TAB
%U week number, Sunday as first day of week
%w day of the week, numerically, Sunday == 0
%W week number, Monday as first day of week
%x date format: 11/19/94
%y year (2 digits)
%Y year (4 digits)
-d days-old, --days=days-old
Only archive messages older than than this many days.
-D date, --date=date
Only archive messages old than this date. The date can be any date understood by Perl's Date::Parse module.
-R, --only-read
Only archive messages that are marked seen or read.
--delete-immediately
Synchonize the mailboxes after every message is moved. This will be substantially slower but may provide better recovery for some mail-
box formats in the event of a crash.
--preserve-timestamp
Preserve the atime and mtime of the input mailbox. This only affects file-based mailboxes, such as mbox.
-n, --dry-run
Go through all the motions of archiving the mail, but don't actually change any mailboxes.
-v, --verbose
Output more informational messages. Use multiple times for more verbosity.
-q, --quiet
Don't output any messages other than error messages.
-V, --version
Print the version number then exit.
-h, --help
Print usage information then exit.
EXAMPLES
Archive two day old messages in inbox to inbox-old:
chewmail --days 2 -o inbox-old inbox
Archive read messages to a mailbox named the year-month of the message:
chewmail --only-read -o %Y-%m inbox
SEE ALSO
archivemail(1), Date::Parse, Date::Format, Mail::Box
AUTHOR
Eric Dorland <eric@kuroneko.ca>
perl v5.8.8 2006-08-15 CHEWMAIL(1)