#!/bin/sh find ./src -name '*.erl' -printf '%T@ %p\n' \ | sort -r | head -n1 | cut -d' ' -f2 | while read file do out_file="$(basename "$file" | cut -d'.' -f1)" echo "------------------------------------" echo "Compiling file '${file}' into '${out_file}'" ( set -x time dialyzer -Wno_unknown --src "$file" || exit 1 erlc -Wall -Werror "$file" ) echo "------------------------------------" done