You are not logged in.
Hello community,
I know that this has something to do with subshells but I could not solve it with a quick search.
$ echo hello
hello
But when I give:
$ echo "echo hello" | at 11:54
warning: commands will be executed using /bin/sh
job 15 at Fri Dec 10 11:54:00 2021
there is no output in the terminal after the job is executed.
I actually want to execute a python script that produces output using the same method. But I suppose that what works for echo will work for pyhton scripts.
Last edited by tethys (2021-12-10 13:13:53)
Offline
The at-job shall be executed in a separate invocation of the shell, running in a separate process group with no controlling terminal, except that the environment variables, current working directory, file creation mask, and other implementation-defined execution-time attributes in effect when the at utility is executed shall be retained and used when the at-job is executed.
[…]
OPTIONS
-m Send mail to the invoking user after the at-job has run, announcing its completion. Standard output and standard error produced by the at-job shall be mailed to the user as well, unless redirected elsewhere. Mail shall be sent even if the job produces no output.
If -m is not used, the job's standard output and standard error shall be provided to the user by means of mail, unless they are redirected elsewhere; if there is no such
output to provide, the implementation need not notify the user of the job's completion.
I have never used at myself, but I guess unless you specify where the output should go, it won't show up anywhere.
Offline
The at-job shall be executed in a separate invocation of the shell, running in a separate process group with no controlling terminal ...
Thank you ayekat for your answer, I missed that. I guess that solves the question asked in this thread. I will try to implement the function I need in the python script itself.
Offline
echo "echo snafu > $TTY" | at now + 1 minute
Offline
I take it the above was meant as a placeholder, right? To actually implement it:
echo "echo snafu > $(tty)" | at ...
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
"zshism"
Offline
Thank you for all your answers. I finally learned something about tty.
Offline