#!/bin/bash # Script adds a MD5-Hash as a get-parameter to all javascript-sourced-files in order to get around # delivery of old content from caches. md5sum *.js | while read l; do md5=$(echo $l|cut -d " " -f 1) filename=$(echo $l|cut -d " " -f 2) sed -e "s/src=\"${filename}\"/src=\"${filename}?md5=${md5}\"/g" $1 > tmp.$$ mv tmp.$$ $1 done