Hi,
I grep for a pattern in a list of files.
"grep -i -l $pattern *.datx*"
it may give me n number of files.
say for eg, it gives me 2 files.
lock_eicu_20071228_00000000.dat_20071228_05343100
lock_eicu_20080501_00000000.dat_20080501_05343900
out of these 2 files I need to get the... (7 Replies)
hi all,
not sure if this has been posted b4 but i try to search but not valid.
this is my question:
when i do a ls -ltr there will be a list generated as follows:
-rw-r--r-- 1 root sys 923260 Jan 10 04:38 FilePolling.41025.083TL021.xml
-rw-r--r-- 1 root sys 1761337 Jan 10 04:40... (12 Replies)
OK, I am a little new to AIX 5.3 and also to scripting. I have a shell script that I wrote and am having difficulty pushing specific files by the system date. Here is my script:
#!/usr/bin/sh
RSYNC=/usr/local/bin/rsync
SSH=/usr/local/bin/ssh
KEY=<path> somekey.key
RUSER=mike... (4 Replies)
Gurus,
From a file I need to remove duplicate rows based on the first column data but also we need to consider a date column where we need to keep the latest date (13th column).
Ex:
Input File:
Output File:
I know how to take out the duplicates but I couldn't figure out... (5 Replies)
Hi All,
Need a small help. I have a log file which keeps updating for every Minute with multiple number of lines. I just want to grep few properties which has latest Date and Time to it. How do i do it?
I wanted to grep a property by name "Reloading cache with a maximum of" from the... (4 Replies)
hi i need the shell script to get the file with latest date.
for example in my input folder i have files like
file_20130212.txt
file_20130211.txt
now my output folder should have the file with latest date i.e..file_20120212.txt
i want to get the latest file .. i.e is should take... (6 Replies)
Hi,
We've a list of files that gets created on a weekly basis and it has got a date and time embedded to it. Below are the examples. I want to find out how to get the latest files get the date and time stamp out of it.
Files are
PQR123.PLL.M989898.201308012254.gpg... (1 Reply)
i have files like
1)20131112_abc_01.csv and
2)20131113_abc_01.csv and
3)20131113_abc_02.csv
when i try to fetch the file in the next day. it shud pick the third file..
plz help me..
and i use `date +"%Y%m%d"` command to fetch..it fetches the current date... (2 Replies)
Hi All,
Please help.
I have requirement to read the file / folder based on the latest date and download the file and folder.
There will be files and folders in the location like
20140630-144422
20140630-144422.csv
20140707-182653
20140707-182653.csv
20140710-183153... (7 Replies)
Hi there
I am trying to write a script where I will need to look for a specific word in the log file and I am aware this can be done by grep for example.
As there will be multiple entries for this I want to grep the last one to enter the log... how would I go about this - would I have to use... (5 Replies)
Discussion started by: simpsa27
5 Replies
LEARN ABOUT SUNOS
sortm
SORTM(1) [nmh-1.5] SORTM(1)NAME
sortm - sort messages
SYNOPSIS
sortm [+folder] [msgs] [-datefield field] [-textfield field] [-notextfield] [-limit days] [-nolimit] [-verbose | -noverbose] [-version]
[-help]
DESCRIPTION
Sortm sorts the specified messages in the named folder according to the chronological order of the "Date:" field of each message.
The -verbose switch directs sortm to tell the user the general actions that it is taking to place the folder in sorted order.
The -datefield field switch tells sortm the name of the field to use when making the date comparison. If the user has a special field in
each message, such as "BB-Posted:" or "Delivery-Date:", then the -datefield switch can be used to direct sortm which field to examine.
The -textfield field switch causes sortm to sort messages by the specified text field. If this field is "subject", any leading "re:" is
stripped off. In any case, all characters except letters and numbers are stripped and the resulting strings are sorted datefield-major,
textfield-minor, using a case insensitive comparison.
With -textfield field, if -limit days is specified, messages with similar textfields that are dated within `days' of each other appear
together. Specifying -nolimit makes the limit infinity. With -limit 0, the sort is instead made textfield-major, date-minor.
For example, to order a folder by date-major, subject-minor, use:
sortm -textfield subject +folder
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
SEE ALSO folder(1)DEFAULTS
`+folder' defaults to the current folder
`msgs"'defaultstoall"
`-datefield' defaults to date
`-notextfield'
`-noverbose'
`-nolimit'
CONTEXT
If a folder is given, it will become the current folder. If the current message is moved, sortm
will preserve its status as current.
HISTORY
Timezones used to be ignored when comparing dates: they aren't any more.
Messages which were in the folder, but not specified by `msgs', used to be moved to the end of the folder; now such messages are left
untouched.
Sortm sometimes did not preserve the message numbering in a folder (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after
sorting). This was a bug, and has been fixed. To compress the message numbering in a folder, use "folder -pack" as always.
BUGS
If sortm encounters a message without a date-field, or if the message has a date-field that sortm cannot parse, then sortm attempts to keep
the message in the same relative position. This does not always work. For instance, if the first message encountered lacks a date which
can be parsed, then it will usually be placed at the end of the messages being sorted.
When sortm complains about a message which it can't temporally order, it complains about the message number prior to sorting. It should
indicate what the message number will be after sorting.
MH.6.8 11 June 2012 SORTM(1)