I see there is some confusion about how to use the at(1) command. Several of the things you tried were correct, however you came to the incorrect conclusion that at was not working.
The important thing to remember about at or cron jobs is that they run in a sanitized environment. They cannot access the screen without jumping through some extra hoops, and they cannot write text to your terminal window. The output from at/cron jobs will be emailed to you (unless you redirect the output).
If you have an MTA installed (such as postfix or exim4), then you will receive the email. If you do not have an MTA installed, then the output goes to the bit bucket. Check your log files (/var/log/syslog). You will probably see a message that says something like (this is from memory): CRON: no MTA installed, discarding output.
Here's the exact message you'll see in the log if the at daemon cannot find an MTA:
Code:
atd[pid]: Exec failed for mail command: No such file or directory
So the first thing you should do is install an MTA so that you can receive locally generated email.
Now, on to your examples:
Code:
$ echo "ciao" | at now
warning: commands will be executed using /bin/sh
job 346 at Wed Jun 8 09:39:00 2011
This will work. However, the at daemon attempts to execute a program named "ciao". Then it sends you an email that says it can't find "ciao". Remember that the "echo" here runs in your current shell (not the at daemon shell).
Code:
$ at 9:41
warning: commands will be executed using /bin/sh
at> echo "ciao"
at> <EOT>
job 347 at Wed Jun 8 09:41:00 2011
This will work. The at daemon executed the echo command and the "caio" is sent to the standard output, which is then emailed to you.
And now here's the hoop you need to get gedit to work. Since the environment has been sanitized, it does not have the $DISPLAY variable that it needs. The following will work:
Code:
$ at now
warning: commands will be executed using /bin/sh
at> env DISPLAY=:0 gedit
at> <EOT>
Bookmarks