#! /usr/bin/env bash # # Replace columns from "zeekctl df" output that are not predictable with Xs. awk '{ if ( $0 !~ /total[ ]+avail/ ) { $2 = "/xxx/xxx" # Check the format of each field, and replace with Xs only if the # format is expected (some fields have unpredictable length, but # we need a constant-width string of Xs). if ( $3 ~ /^[0-9]+[KMG]$/ ) { $3 = "XXX" } if ( $4 ~ /^[0-9]+[KMG]$/ ) { $4 = "XXX" } if ( $5 ~ /^[0-9]+\.[0-9]$/ ) { $5 = "XX.X" } } print }'