How can I get the output below using shell commands?
Input as below:
Nexus-test-1.12.3
Producer-1.13.3
Testing-one-word-1.12
Output should be
Nexus-test
Producer
Testing-one-word
How can I get the output below using shell commands?
Input as below:
Nexus-test-1.12.3
Producer-1.13.3
Testing-one-word-1.12
Output should be
Nexus-test
Producer
Testing-one-word
I really struggle with whether or not to answer this, because it's incredibly trivial and it appears that zero effort has been made to figure it out. But....just do:
cut -d . -f 1
There are many ways to do it, hope you can do a search first.
awk -F'.' '{$0=$1}7'
sed 's/[.]*//'
grep -Po '^[^.]*'