#!/usr/bin/awk -f # # Pretty-printed "mount" output for FreeBSD. # # Copyright (C) 1999, 2000 Oliver Fromme # Use and distrubute under BSD license. # BEGIN{ i = 0; devmax = pntmax = 6; while (("/sbin/mount" | getline) > 0) { dev[i] = $1; if (length($1) > devmax) devmax = length($1); pnt[i] = $3; if (length($3) > pntmax) pntmax = length($3); sub(/\(/, "", $4); sub(/\)/, "", $NF); for (j = 4; j <= NF; j++) { x = $j; gsub(/[,:]/, "", x); # Make some flags shorter to save some space. sub(/synchronous/, "sync", x) if (x == "writes") break; # Omit "writes: x sync y async". else if (x == "soft-updates") x = "s-upds"; else if (x == "with") x = ""; # This is for "with quotas". if (x) if (x == "exported") opt[i] = opt[i] "-exp"; else if (opt[i]) opt[i] = opt[i] " " x; else opt[i] = x; } i++; } printf "%-*s %-*s %s\n", devmax, "Device", pntmax, "MntPnt", "Flags"; printf "%-*s %-*s %s\n", devmax, "======", pntmax, "======", "====="; for (j = 0; j < i; j++) printf "%-*s %-*s %s\n", devmax, dev[j], pntmax, pnt[j], opt[j]; }