I'm writing a shell script that makes sure my DNS server is looking. Here's the output it tests:
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: galapagos.office
Address: 192.168.140.25
Everything but the "galapagos.office" needs to match exactly. The "galapagos.office" part itself doesn't actually matter at all.
I figure I can apply this regex to the output to tell me if it looks how I want:
Server: +127\.0\.0\.1\nAddress: +127\.0\.0\.1#53\n\nName:.+\nAddress: 192\.168\.140\.25
The thing is I don't really know shell scripting. What's the best way to make sure that regex matches the output of an nslookup command?