Register
It is currently Thu Apr 17, 2014 4:04 pm

svn script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Thu Apr 14, 2011 7:07 am   

Joined: Thu Apr 14, 2011 6:57 am
Posts: 2
hi all,

im trying to send a mail with the output of a svn server.

Code:
#!/bin/sh
REV="2"
REPOS="/home/user/svn/"
SVNDIR="/usr/bin"
COMMENT="123456780"
#CUT=${COMMENT:0:2}
UP=`$SVNDIR/svnlook changed -r${REV} ${REPOS} | awk '{ print $1 }' | grep -c U`
ADD=`$SVNDIR/svnlook changed -r${REV} ${REPOS} | awk '{ print $1 }' | grep -c A`
DEL=`$SVNDIR/svnlook changed -r${REV} ${REPOS} | awk '{ print $1 }' | grep -c D`

echo  "$REV (${UP}, ${ADD}, ${DEL}): ...." | mail -s "HI ALL - CAHNGE [${REV}]" mail@example.com



so on my mail i get

2 (0, 3860, 0): ....

why up is 0 if i run svnlook changed -r${REV} ${REPOS} | awk '{ print $1 }' | grep -c U on a shell, give me:

A def/lib/vendor/symfony/test/unit/validator/sfValidatorSchemaCompareTest.php
A def/lib/vendor/symfony/test/unit/validator/sfValidatorSchemaFilterTest.php
A def/lib/vendor/symfony/test/unit/validator/sfValidatorSchemaForEachTest.php
A def/lib/vendor/symfony/test/unit/validator/sfValidatorSchemaTest.php
A def/lib/vendor/symfony/test/unit/validator/sfValidatorStringTest.php
A def/lib/vendor/symfony/test/unit/validator/sfValidatorTimeTest.php
A def/lib/vendor/symfony/test/unit/validator/sfValidatorUrlTest.php
........ etc

Thanks


Top
 Profile  
 PostPosted: Fri Apr 15, 2011 12:11 am   

Joined: Thu Apr 14, 2011 6:57 am
Posts: 2
mmm grep -c is to count lines....


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP