Home » Questions » Computers [ Ask a new question ]

SED: how to pull out version string

SED: how to pull out version string

I would like to use sed to pull out the version number from the command:

Asked by: Guest | Views: 277
Total answers/comments: 2
Guest [Entry]

"I know this isn't using sed, but based upon your output this is easier.

svnversion --version | head -1 | awk '{print $3}'

If you have perl available...

svnversion --version | perl -lne 'print $1 if /version (\d+.\d+.\d+)/'"
Guest [Entry]

"One more way to do it w/o sed:
svnversion --version | head -1 | cut -d"" "" -f3"