#976230 at command does not start job, if I remove directory, it was launched from

Package:
at
Source:
at
Description:
Delayed job execution and batch processing
Submitter:
tyghr
Date:
2020-12-01 21:33:04 UTC
Severity:
normal
#976230#5
Date:
2020-12-01 21:28:53 UTC
From:
To:
if I launch at job with commands like this, nothing will happen.

#!/bin/bash
mkdir /tmp/123
cd /tmp/123
echo "some_command" | at now + 1 min
cd /tmp
rmdir /tmp/123
exit 0

if I change that script by commenting 6th line. It will work.

#!/bin/bash
mkdir /tmp/123
cd /tmp/123
echo "some_command" | at now + 1 min
cd /tmp
#rmdir /tmp/123
exit 0

It is not obvious, that at uses current working directory. I think it is a
bug.

Tested on last available versions on Buster(at 3.1.23-1), Stretch(at
3.1.20-3), Jessie(at 3.1.16-3)