Ich versuche die Versionsnummer von Mono per Shell heraus zu finden. Die Ausgabe von mono -V sieht bei mir so aus:
Mono JIT compiler version 1.2.6 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: __thread GC: Included Boehm (with typed GC) SIGSEGV: altstack Notifications: epoll Architecture: x86 Disabled: none
Nun will ich hier die Versionsnummer extrahieren. Dazu hab ich folgenden regulären Ausdruck erstellt: [^\d]*([\d+\.]+\d+).*
Wie kann ich das jetzt auf die Ausgabe von Mono anwenden? In python würde ich das so machen:
re.compile("[^\d]*([\d+\.]+\d+).*").match("blabla 1.34.5 asdfasd").group(1)
Wie geht's in der Shell?