[Geany] Applying sort to grep results

Enrico Tröger enrico.troeger at xxxxx
Sun Dec 20 00:04:37 UTC 2009


On Thu, 17 Dec 2009 14:02:38 +0100, Milan wrote:

>Hi,
>
>many times I use Geany's "find in files" function to search for some
>string inside directory. The problem is that results are not sorted at
>all (at least, I cannot find a critera: it isn't file timestamp or
>filename).
>
>Would it be possible to sort the result alphabetically (or any other
>way). Just piping grep to sort(1) would be sufficient to me.

I'm not sure it's wise to include that into Geany itself. Piping the
results simply to sort should be simple enough but then there is
Windows (where 'sort' doesn't exist or at least behaves different from
Unix-like 'sort') and, more importantly, once we would implement it,
users would like to configure sorting criteria and such. Then we would
need to provide a GUI for that which IMO just bloats that feature to
some unnecessary extend.
Alternatively, a 1.5 minute hacked shell script is attached which
simply wraps the call from Geany to grep, calls the real grep and then
sort its output.
Simply save that script into your filesystem, make it executable
(chmod +x ...) and enter the path to the script in Geany's preferences
dialog, Tools tab as Grep command.


>P.S. I guess I don't have to tell you that Geany is great! because you
>already know that :)

Hehe, thanks.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grep_sorted
Type: application/octet-stream
Size: 29 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20091220/a7eb48f4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20091220/a7eb48f4/attachment.pgp>


More information about the Users mailing list