0

When entering commands into the at> prompt, I am unable to activate command-line autocompletion using the Tab key.

$ at now + 4 hour
at> 

Is there a way to turn on tab completion in the at> prompt?

I am using CentOS 7 and Bash with at version at-3.1.13-24.el7.x86_64.

1

You could use your interactive shell's here-document feature to write the commands, and pass the result to at via stdin (rather than having at open and read stdin itself):

$ cat <<EOF | at now + 4 hour
> echo 'doing stuff now' >/tmp/foo
> EOF
warning: commands will be executed using /bin/sh
job 22 at Wed Jun 10 16:11:00 2020

At least on my system (Ubuntu / bash 4.4.20(1)), tab completion works inside the here-doc - for completing the /tmp/foo filename for example.

1
  • Impressive. I wouldn't even have thought of trying that. Who uses that feature interactively? I would like to add that you can use read -e for that, too. – Hauke Laging Jun 11 '20 at 2:22
0

Probably not:

 ldd /usr/bin/at
        linux-vdso.so.1 (0x00007ffd24182000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f70946ed000)
        libfl.so.2 => /usr/lib64/libfl.so.2 (0x00007f70946e8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f70948f8000)

(My) at is not linked against readline (or something similar).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.