Reputation: 6228
I tried this.
'svn info | grep revision'
so I can get
Revision: 36991
but the word I want is only
36991
how can I do this? maybe with 'grep
'
or shell script
Upvotes: 0
Views: 96
Reputation: 10250
You can use sed, the stream editor (or awk or cut).
svn info | grep revision | sed "s/[^0-9]\+//"
svn info | sed -e '/revision/!d' -e 's/[^0-9]\+//'
svn info | awk '/revision/ { print $2 }'
svn info | grep revision | cut -d ' ' -f 2
Upvotes: 1
Reputation: 77105
Will this work for you -
svn info | awk '/Revision/{ print $2 }'
Upvotes: 4