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

Re: Hook Scripts; How to Send Message to User?

From: Ryan Schmidt <subversion-2009b_at_ryandesign.com>
Date: Tue, 9 Jun 2009 19:19:45 -0500

David's response explained the best way to solve this, but for
completeness I wanted to point to the error in your original script.

On Jun 9, 2009, at 10:17, Tom Browder wrote:

> # Check that the incoming files meet name requirements.
> /path/to/check-allowed-names.pl $1 $2 > /dev/null 2>&1

">/dev/null 2>&1" is equivalent to "1>/dev/null 2>&1" and means "send
anything that would have gone to file handle 1 (stdout) to the null
device (i.e. throw it away), and then redirect file handle 2 (stderr)
to go to the same place as file handle 1 (i.e. also the null device).
So both stdout and stderr output from the perl script is being
discarded. If this is what you wanted then this is fine.

> if [ $? != '0' ] ; then
> cat /path/to/msg 2>&1
> exit 1
> fi

"2>&1" means "send anything that would have gone to file handle 2
(stderr) to file handle 1 (stdout) instead." This is probably the
reverse of what you wanted, which was to send cat's output on stdout
to stderr instead, so that the client would see it, which can be
accomplished with "1>&2".

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2360765

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-10 02:21:13 CEST

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.