[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: STDOUT and Hook Scripts

From: Ted Stern <dodecatheon_at_gmail.com>
Date: Wed, 10 Mar 2010 10:31:30 -0800

On 10 Mar 2010 05:30:03 -0800, David Weintraub wrote:
>
> I know that when you run a hook, the STDOUT is not returned to the
> user, and STDERR is only returned if that hook returns a non-zero exit
> code.
>
> However, I'm writing a post-commit hook, and I'd like to know if it is
> possible to pipe STDOUT to another process as part of the hook script.
> For example, in a post-commit hook, I have a Perl script that collects
> watch information, and I'd like to pipe the output of that script to
> another script that will do the actual notification. Can I do the
> following in my post-commit script:
>
> watch-file.pl | notify.pl
>
> Is that possible?

What about this basic shell manipulation?

#!/bin/sh

exec 1>&2 # combine stdout with stderr

# do stuff that generates stdout

if [ <condition> ] ; then
   exit 1 # return non-zero exit every time there's stdout
fi

Ted

-- 
 Frango ut patefaciam -- I break so that I may reveal
Received on 2010-03-10 19:32:09 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.