This question already has an answer here:
- How to print only last column? 9 answers
I would like to extract substring after colon delimiter for my practical needs using GNU awk utility.
For example I can extract the temperature of hdd value using
cut as follows
hddtemp /dev/sda | cut -d ':' -f3
The same example written in
hddtemp /dev/sda | sed 's/.*\://'
For glory of Saint Completeness and GNU Trinity (awk, cut, sed)
I wonder, can GNU
awk do such thing?
/dev/sda: ST500LT012-9WS142: 47°C