Oops. And a brainteaser. Re: The Hosstraders retire
Michael ODonnell
michael.odonnell at comcast.net
Sun Feb 18 10:05:43 EST 2007
>>grep -in "hosstrad" ~/Mail/...gnhlug.x/*
>
>Perhaps the shell did not expand the file names in dated order
You're right about that, but that would only be part of the
problem; MH msgs are stored in files with simple numeric names
like 1, 2, 423, 1111, etc, but although the numeric ordering
of those file names initially reflects the order in which the
msgs arrive in the folder in question (each new msg is written
into a file whose name is the number of the current largest
numeric filename + 1) there are all sorts (pun intended) of
operations that can affect which msgs reside in which files, so
it's generally not a safe assumption that the numeric ordering
of the filenames reflects the timestamp ordering of the msgs
they contain. For example, this command:
sortm +inbox -textfield subject -nolimit -verbose
...would reorder (ie. rename) all files in your inbox such
that messages in the same thread would be grouped together,
sorted by date within each thread. The resultant numeric
ordering of the filenames would then be useless for figuring
out the timestamp ordering of the msgs.
If I wanted to force the filename/timestamp ordering in
question I might do this:
sortm +myGNHLUGemailFolder # default sort key is Date:
...and then my approach to Bill's search might be this:
cd ~/Mail/myGNHLUGemailFolder
grep -in "hosstrad" $( ls [0-9]* | sort -n )
More information about the gnhlug-discuss
mailing list