I am trying to pull certain pieces of data out of a line of a file that matches a certain pattern:
[0-9][0-9][.][0-9]
The three pieces that I want to pull out of this line are the only occurrences of that pattern within the line, but the rest of the line is not consistent in each file. Basically the line is the output of uptime, which could be any of the following:
Even though those examples are all boring (with 0.00 load on all cases) I need to pull out those numbers and put them into separate variables.
I assumed I could do this with sed (mostly because I know sed better than awk or grep) but I have been struggling for a while and would like some guidance...
I have seen plenty of search results dealing with deleting lines that contained the pattern or ones that didn't contain the patters, but nothing about keeping just parts of a line that match the pattern.
I even tried deleting everything in the line that DID NOT match that patters, but that didn't pan out either.