I need to return the most recent value from a log file. I know this value will always be near the end of the log file, and I only ever want one result.
On Ubuntu I've accomplished this with
tac dhcp.log | grep macaddress -m 1, and on Solaris I've almost replicated this with
tail -r dhcp.log | grep macaddress, but it runs through the entire file which is quite large and takes too long. Is there any way to kill grep after the first result so that it doesn't run through the entire file?