#!/bin/bash set -eu tar -Oxf "$1" | \ awk 'BEGIN {RS=""} $1 == "%NAME%" {printf "%s ", $2} $1 == "%VERSION%" {print $2}'