Search code examples
svnbashpropertiescommand-line-interfacerevision

How to generate a java .property file of the latest svn revision number from command line?


We are putting the svn revision number in the uploaded binary package, so the server and client know each other's revision number.

We choose to use java .property file because it is trivial to use.

The closest I can get is ( a bash file )

echo "svn.revision="

svnversion

But it consists of two lines. I need one line of svn.revision=9353.


Solution

  • Use the "-n" option on echo to suppress the newline:

    echo -n "svn.revision="