Skip to content

Instantly share code, notes, and snippets.

@nestoru
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nestoru/9690992 to your computer and use it in GitHub Desktop.
Save nestoru/9690992 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
# /opt/scripts/svn-cat-tag-versions.sh
# @author: Nestor Urquiza
# @date: 20140319
USAGE="Usage: `basename $0` <tag_base_url> <file_path> <version_from> <version_to>"
if [ $# -ne "4" ]
then
echo $USAGE
exit 1
fi
tag_base_url=$1
file_path=$2
version_from=$3
version_to=$4
# one liner
svn ls $tag_base_url | \
sort -t . -k 1,1 -k 2,2n -k 3,3n | \
grep -A 1000000 "$version_from" | \
grep -B 1000000 "$version_to" | \
while read version ; do echo "/*****$version*****/"; svn cat $tag_base_url/$version/$file_path; echo; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment