#!/bin/sh set -eu skelfile="$1"; shift pkgdesc=$(perl -nE '/^[#]{2} (.*)/ and say "# $1"; /^[#]{1} (.*)/ and say "# * $1"' "$@") #' pkglist=$(perl -ne 'chomp; /^[^#]+/ and print "$_ "' "$@") export pkgdesc pkglist perl -pe 's,__PKGDESC__,$ENV{"pkgdesc"},;s,__PKGLIST__,$ENV{"pkglist"},' < $skelfile