Through bash, I am trying to extract part of a line from a file.
Currently I am using two sed commands back to back like so:
sed -n -e "s/^abc=//p" file | sed -n -e "s/\.//gp"
which can take in abc=1.2.3 and spit out 123. This got me thinking... Can I achieve this with just one command call? As in I want to find all strings in a file that match abc=<digit1>\.<digit2>\.<digit3> and spit out <digit1><digit2><digit3>.
EDIT:
Just to clarify, I want this to only print out lines that match. For instance, if I have the following file:
1.2.3.4
abc=quack
qtip=1.2.3
abc=1.2.3
abc = 4.5.6
running the command should only print 123