#!/bin/sh for f in "$@"; do echo "File: $f" echo pngmeta --quiet "$f" | nawk ' function output() { colon = index($0, ":") printf "%-16s%s\n", substr($0, 1, colon - 1), substr($0, colon + 2) } /^Title: / { output(); next } /^Author: / { output(); next } /^Description: / { output(); next } /^Copyright: / { output(); next } /^Creation Time: / { output(); next } /^Software: / { output(); next } /^Disclaimer: / { output(); next } /^Warning: / { output(); next } /^Source: / { output(); next } /^Comment: / { output(); next } { printf "%16s%s\n", "", $0 }' echo done .