Refine this utility.
chris glur
crglur at gmail.com
Sun Jan 27 16:52:59 UTC 2013
Google is becoming the most powerful entity in the world,
because knowledge search, AND FIND, is the most profitable
activity, at this stage of humanity's technological development.
`mc` has got some nice little search aids.
An important reason why *pdf is to be discouraged, is that it HOGS
text search.
Here's a well used/tested script to find eg. that critical file
which mentioned <String1> <String2> <String3> which you read in
the last D-days, and fortunately you're confident that it's in
the DirectoryTree $5:--------
#!/bin/bash
echo ' Fnd3StrngsD DaysOld Str1 Str2 Str3 DirTree'
find $5 -type f -ctime -$1 -print0 | \
xargs -0 grep -l $2 | tr "\n" "\0" | \
xargs -0 grep -l $3 | tr "\n" "\0" | \
xargs -0 grep -l $4
--------------- EOF ----------------
Now lets evolve a script that:
Finds a string which we recently read/editied with `mc`,
in some unknown file, by hopefully using <mc's history>,
or what ever YOU can think of.
BTW, mc is well respected by those who've found its use, although there's a
substantial sector who have a macho-kiddie attitude that "I don't need menus
and memory aids, and I can type fluently like Rubenstein plays the piano".
OTOH, mc-users are missing out on the [should be there] USER contributed
library of utilities, which conveniently hook-into the existing mc framework.
Real successful projects flourish by user contributions; not just fixing
patches reported by users.
Here's my initial stab at the above problem:-
=> Find recent ref to <visual?studio>
==> search <mc-history>
=> whereis <mc-history> == ~/.mc/history
=> how BIG is it? -> cat ~/.mc/history | wc -l == 880
==> is it update at the top or bottom?
== *THIS* file is the latest that mc has 'seen'
-> cat ~/.mc/history | grep AmbigusXmpls == na
=?=> grep AmbigusXmpls is not yet recorded in ~/.mc/history
==> nor when we exit and change panels.
That's dissapointing and surprising, since a related script idea which has
proved successful for 6 months: F1 <string>
successfully list the <files | grep string> which have recently bee visited.
F1 is a mess, with some non-mc-stuff but this is it:--
-> cat `which F1` ==
# p0 == cat /tmp/ObnTmp ; p "text string" == echo $1 >> /tmp/ObnTmp
cat /tmp/ObnTmp | grep $1
cat /s4 | grep $1
#cat /home/Softwr/mcExtend/filepos.history
cat ~/.mc/filepos | grep $1
cat ~/.mc/history | grep $1
------------------------- EOF ----------------------------------
So let's move beyond "how can I get my mc to run properly".
WDYS?
PS. I can't believe that *THIS* file is unknown;
so let me try my PROVEN: -> F1 mbigus
== /mnt/hdc11/AI/LimitSyntx/AmbigusXmpls 60;0
OK, so it's NOT in ~/.mc/history.
It's KNOWN somewhere else, where `F1` searches.
Now lets have others contribute, something: evolve/complete this utility.
More information about the mc
mailing list