tag:blogger.com,1999:blog-462006525194985726.post2177659375885854679..comments2024-03-24T12:41:56.165-04:00Comments on Sandro Tosi: Chain scripts execution in git hooksSandro Tosihttp://www.blogger.com/profile/17077191422205823991noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-462006525194985726.post-50115328321835743622009-10-10T06:25:10.331-04:002009-10-10T06:25:10.331-04:00I suppose you can always chain tee commands:
tee ...I suppose you can always chain tee commands:<br /><br />tee >(command1) | tee >(command2) | command3<br /><br />And it seems that you can even do something like:<br /><br />echo a | tee >(cat) >(cat) >(cat) | cat<br /><br />(at least with zsh)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-462006525194985726.post-53352425043401255412009-05-11T13:56:00.000-04:002009-05-11T13:56:00.000-04:00Thanks for your comments :)
@netfilter: It's pret...Thanks for your comments :)<br /><br />@netfilter: It's pretty much the same, but with different syntax; personally I prefer my version, but indeed it's another solution :)<br /><br />@josh: your code only works for 2 commands to chain together, while there can several commands you want to execute in the same hook (and it's also a little bit "ugly" :) )<br /><br />@dato: very cool tool, nice to know it exists. Sadly, it can only be useful if you have the capability to install executable on the git repository server.Sandro Tosihttps://www.blogger.com/profile/17077191422205823991noreply@blogger.comtag:blogger.com,1999:blog-462006525194985726.post-32561762697870221672009-04-19T04:04:00.000-04:002009-04-19T04:04:00.000-04:00/usr/bin/pee from the moreutils package:
#! /bin/.../usr/bin/pee from the moreutils package:<br /><br />#! /bin/sh<br /><br />exec pee /usr/local/bin/git-commit-notice /git/reportbug/reportbug.git/hooks/git-post-receive-url-notifications.pyDatohttps://www.blogger.com/profile/03261900526069099807noreply@blogger.comtag:blogger.com,1999:blog-462006525194985726.post-87180854440940122312009-04-19T02:15:00.000-04:002009-04-19T02:15:00.000-04:00#!/bin/bash
tee >(command1) | command2#!/bin/bash<br />tee >(command1) | command2Josh Tripletthttps://www.blogger.com/profile/02593171817329248190noreply@blogger.comtag:blogger.com,1999:blog-462006525194985726.post-17638620494545551622009-04-18T20:53:00.000-04:002009-04-18T20:53:00.000-04:00TEXT=`cat`
echo "$TEXT" | command1
...
echo "$TEX...TEXT=`cat`<br /><br />echo "$TEXT" | command1<br />...<br />echo "$TEXT" | commandNAnonymousnoreply@blogger.com