I am writing some scripts that uses ${USER} to point to subsequent scripts. But when I run it from crontab, it errors out and the files are not found. I understand why.

I intend to share this with my colleagues and each time the colleague has to manually change the first line to his own username. How can I minimize this issue (not have a manual way to change that one line)?


It's a typo. You should use $USER, not ${USER}.

Cron parses these lines itself and does only simple variable substitution; it is not a shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.