def METHOD_NAME(ctx, res_name):
    class BashProcessor(Processor):
        @property
        def moduledir(self):
            return os.path.dirname(ctx.filename)
    BashProcessor(None, ocrd_tool=ctx.json['tools'][ctx.tool_name],
                  show_resource=res_name)