Skip to content
Advertisement

Generate a report using awk

I have /etc/fstab entries on 100 servers and i’m trying to write a awk script to identify following.

JavaScript

What i need is, first my awk script need to print the domain name, then it should print

JavaScript

tools incorrectly mounted on store and is not valid, but kdump01 mounted correctly on kdump , ops mounted correctly on ops)

How can i print a report like this using awk or sed ? (print only invalid nfs mounts)

output should be like this

JavaScript

I managed to add the follwing script and it lists servername and mount points

JavaScript

Advertisement

Answer

awk solution (for your current input):

JavaScript

The output:

JavaScript
Advertisement