I have defined in cron
crontab -l >/FIXENGINE/data/crontab.$(whoami).$(date +%a)
The resulting file is named
crontab.fixadmin.
When I run the above from a command line, the file is named:
crontab.fixadmin.Tue (or whatever day I happen to be running)
The question is - why do I get different results.
Any ideas??
John
What shell is cron running under? $() is Korn specific so back ticks may solve your issue; eg. `whoami`.
I assume I'm running under Korn - note that the $(whoami) works
echo $SHELL generated an email to the acct with out a result
I did try `date +%a` (backquotes) - still didn't work
john
Please try to provide a clue or two when you ask questions. It would help a lot to know exactly which OS you use. But from Sun's crontab man page:
I'm guessing that is your issue.
Thank you - you nailed it
I escaped the % sign and it now works fine
crontab -l >/FIXENGINE/data/crontab.$(whoami).$(date +\%a)
Thank you again
John
BTW - am running HPUX 11