Created
December 2, 2021 19:58
-
-
Save markcastle/336a416170a66b5688e2510b3183108c to your computer and use it in GitHub Desktop.
Extract Version string from a dotnet C# project file using just grep and sed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Extract Version string from a dotnet C# project file using just grep and sed... | |
# eg source file ./ProjectFolder/ProjectName.csproj contains.. | |
# <Version>0.0.3</Version> | |
grep -Eoi "<version>([[:digit:]\.]+)</version>" ./ProjectFolder/ProjectName.csproj | sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' | |
# Expected Result... | |
0.0.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment