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

Re: Using svn in a unix pipe

From: Saulius Grazulis <grazulis_at_akl.lt>
Date: 2006-05-03 07:37:05 CEST

On Tuesday 02 May 2006 23:17, Steven Elliott wrote:

Unix has 'xargs' command that can "transfer" arguments from the stdin list to
the command line (see 'man xargs' on unix; beware that it mau be rather
broken on some older flavours of unix, even on Linux...)

> I have so far got
> svn st | egrep ┬│\?┬▓ | sed ┼’s/\?\(.*\)/ \1/┬╣ | svn add
> So svn is outputting to egrep which is taking all the files marked ┬│?┬▓ and
> sending that to sed to strip off the ┬│?┬▓ (which could be ┬│!┬▓ ..etc) which I
> would then like to send to svn add (or delete or...).
> Problem is the stdout is not making it to the add argument.


svn st | egrep "^?" | sed 's/\?\(.*\)/ \1/' | xargs -t svn add


svn st | egrep "^?" | sed 's/\?\(.*\)/ \1/' | xargs -t -n1 svn add

(to add files one by one)

This will probably do what you want.

I have also a script 'svn-add-unknown' which uses backticks and awk for this
purpose. (I attach my svn scripts to this mail)

Dr. Saulius Gra┼żulis
Visuomenin─— organizacija "Atviras Kodas Lietuvai"
P.Vileišio g. 18
LT-10306 Vilnius
Lietuva (Lithuania)
tel/fax:      (+370-5)-210 40 05
mobilus:      (+370-684)-49802, (+370-614)-36366

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

  • application/x-shellscript attachment: svn-ignore
Received on Wed May 3 07:38:22 2006

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.