echo >> "$CRONTAB"
echo "## $file:" >> "$CRONTAB"
+ # Strip licenses, multiple empty lines and fix $HOME variables in PATH
+ # (cron doesn't expand variables).
START_REGEX='^# This [a-zA-Z]* is free software: you can redistribute it'
END_REGEX='^# along with this [a-zA-Z]*. If not, see <[^>]*>\.'
< "$file" sed -e "/$START_REGEX/,/$END_REGEX/ d" \
-e "/^#[ ]*$/ d" \
-e "/^# Copyright (C) [0-9][0-9]* / d" \
| cat --squeeze-blank \
+ | sed "/^PATH/ s:\$HOME:$HOME:g" \
>> "$CRONTAB"
done