#!/bin/sh var=$(date) /usr/bin/sed -i "s|DATE=.*|$(/home/my/script $var)|g" /path/file
Running this script manually works perfectly. As soon as it is ran from
cron, in particular the sed portion of the script, will fail.
The variable will hold the correct content under the
cron environment. Only search/replace fails.