#!/bin/bash set -e . ${0%/*}/../common.sh case "$#" in 0) i=argument/argument.rs; o=argument/blank.rs ;; 2) i="$1"; o="$2"; ;; *) echo >&2 "$0: need 0 or 2 arguments"; exit 16 ;; esac perl -pe ' s{^\s*//.*\n}{}; s{\s*//.*\n}{\n}; ' "$i" >"$o".new perl -i -0777 -pe ' s/^\n\s*\n//; s/\{\n\s*\n/\{\n/g; ' "$o".new mv -f "$o".new "$o"