Get the latest subversion revision number with Bash

Here’s  a quick one-liner you can use in Bash to get the latest subversion revision number from your present working directory:

sed -n '4p' .svn/entries

Use backticks to assign it to a local variable you can use when making a build (say, a zip archive of a website or other type of artifact you might want to create):

version=`sed -n '4p' .svn/entries`

Leave a comment

You must be logged in to post a comment.