How do I extract the names from the gitolite
info command output, for further piping into a script?
I'm writing a migration script to migrate all my repositories from gitolite to a Gitlab server. Thus, I want to get all the repository names from gitolite and use those in Gitlab. Below is the example output I'm trying to match against.
hello sitaram, this is gitolite v2.1-29-g5a125fa running on git 188.8.131.52 the gitolite config gives you the following access: R SecureBrowse R W anu-wsd R W entrans @R W git-notes @R W gitolite R W gitolite-admin R W indic_web_input @C R W private/sitaram/[\w.-]+ R W proxy @C @R W public/sitaram/[\w.-]+ @R_ @W_ testing R W vic
This should output:
SecureBrowse anu-wsd entrans git-notes gitolite gitolite-admin indic_web_input proxy testing vkc
Currently I'm trying to put this in a shell script, so it would be usable for others. My current approach is a
grep command, which looks like the following:
grep -Eio "([A-Za-z0-9_-]+)$" gitolite-info-output
However, this also captures the
4 at the end of the first line. I've been trying several approaches, but I can't seem to exclude that properly, without including or excluding other things.
Doing this OS X 10.10.3.