When I execute the following svn
command, I get the below output.
$ svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/bulk-delete
------------------------------------------------------------------------
r91525 | plugin-master | 2009-02-03 10:39:23 +0530 (Tue, 03 Feb 2009) | 1 line
adding bulk-delete by sudar
------------------------------------------------------------------------
I am writing a shell script and I want to parse the output of the above command and get the revision number (r91525 in this case) and store it in a shell variable, so that I can use it in the subsequent commands.
I tried the cut command and was able to get the revision number in the second line, but the other lines were still appearing.
$ svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/bulk-delete | cut -f1 -d'|'
------------------------------------------------------------------------
r91525
adding bulk-delete by sudar
------------------------------------------------------------------------
Question: How to retrieve the revision number and store in a shell variable, so that I can use it in the subsequent commands?