Do I understand correctly that the job should be run by bash rather than plan sh? $ at -c 2134 #!/bin/sh ... SHELL=/bin/bash; export SHELL ... ${SHELL:-/bin/sh} << 'marcinDELIMITER2c849ce9' ... marcinDELIMITER2c849ce9 $ echo $SHELL /bin/bash
I'm sorry for such late response. The job should be executed by your preferred shell. It should work also for people who has as default csh. If you have bash as the default shell, then it's working properly.
My $SHELL is /bin/bash, however, you can see at the top of this script that it invokes /bin/sh. Am I missing something?
If you read whole at job, you will see there is a line: SHELL=your_shell; export SHELL This shell is used for execution of the job. The /bin/sh is used only by at, not by your job. Do you have a reproducer, where it didn't work? I tested it with csh and it worked fine.
I tried to reproduce and I think I proved myself wrong: echo 'DATE_CMD="date +%Y-%m-%d-%H-%M-%S-%N"; echo `$(DATE_CMD)` > /tmp/at.`$(DATE_CMD)`.out; ps -c -h -p $$ >> /tmp/at.`$(DATE_CMD)`.out' | at -m 1518 I still don't understand why DATE_CMD is not evaluated the way I expect. This style of evaluation works under cron. I wish $() would do nested evaluation. Thanks for taking the time.
I guess at has bash script inside of bash script, so you probably have to add more apostrophes somewhere. Anyway not a bug for me.