0

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)?

Dave M
  • 4,494
  • 21
  • 30
  • 30
SEU
  • 101

1 Answers1

2

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940