I am trying to have the following cron executed with a certain user.U=`/usr/bin/w | grep -w :0 | awk '{ print $1 }'`*/1 * * * * $U /opt/script.shIt seems the deamon doesn't know how to interpret this command; I get :/usr/sbin/cron[18698]: (CRON) bad username (/etc/cron.d/script)Is there any way to do this ?
In crontab is it possible to specify a user from a variable?
users;cron