#!/bin/sh # Date in RFC5322 on UTC TZ CURR_DATE=$(date --utc --iso-8601=seconds) UPDATED_FILTERS=$(git status --porcelain filters | awk 'match($1, "A") || match($1, "M") || match($1, "?") {print $2}') OLDIFS="$IFS" IFS=" " for filter in $UPDATED_FILTERS; do sed -i "s/! Last modified:.*/! Last modified: $CURR_DATE/g" "$filter" done IFS="$OLDIFS"