Bug 1030100 - at doesn't seem to honor $SHELL
Summary: at doesn't seem to honor $SHELL
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: at
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-13 22:40 UTC by John Schmitt
Modified: 2013-12-11 13:42 UTC (History)
2 users (show)

Fixed In Version: at-3.1.13-13.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-11 13:42:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description John Schmitt 2013-11-13 22:40:29 UTC
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

Comment 1 Marcela Mašláňová 2013-12-02 11:09:26 UTC
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.

Comment 2 John Schmitt 2013-12-02 17:29:23 UTC
My $SHELL is /bin/bash, however, you can see at the top of this script that it invokes /bin/sh.  Am I missing something?

Comment 3 Marcela Mašláňová 2013-12-04 14:38:09 UTC
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.

Comment 4 John Schmitt 2013-12-05 23:22:50 UTC
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.

Comment 5 Marcela Mašláňová 2013-12-11 13:42:47 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.