Re: [dev] [query] A tool for filtering lists of filenames with return codes

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri, 20 May 2016 10:56:03 +0200

On Thu, May 19, 2016 at 05:09:55PM -0700, Eric Pruitt wrote:
> I wrote a tool for filtering lists of files based on return codes of
> subprocesses called "query:" https://github.com/ericpruitt/query .
>
> Find all dynamically linked executables:
>
> find -type f | query sh -c 'ldd "$QUERY_FILENAME"'
>
> Find all files ending in ".json" that are malformed:
>
> find -type f -iname '*.json' | query -s ! python -m json.tool
>
> The tool should pretty portable. I haven't tested it on FreeBSD or
> OpenBSD yet, but I was able to compile it on Mac OS X. I am using
> signal(2) whose behavior varies across platforms, but I don't think that
> will be a problem in practice since the handler only calls exit(3).
> Please let me know what you think of the idea and code.
>
> Thanks,
> Eric
>

Hi,

Briefly tested on OpenBSD and found a small issue (patch attached).

-- 
Kind regards,
Hiltjo
Received on Fri May 20 2016 - 10:56:03 CEST

This archive was generated by hypermail 2.3.0 : Fri May 20 2016 - 11:00:13 CEST