[SOLVED] The "at" command , cannot get it to work correctly
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
peter@peter-Lenovo-G580 ~ $ at now + 1 minute
warning: commands will be executed using /bin/sh
at> cd ~/rhag
...
Your tilde path, ~/rhag, is not going to be recognized by /bin/sh. /bin/bash knows how to handle a tilde, so does /bin/ksh (if that's installed on your system), but /bin/sh does not understand the tilde. Thus your cd will not work under /bin/sh, and /bin/sh is what "at" uses - says so right there when you invoke it. Skip the tilde and specify your path as /home/rhag (or whatever the correct path to your $HOME directory is).
Do not assume that /bin/sh points to /bin/bash. On my system it does not:
Code:
$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Mar 11 2013 /bin/sh -> dash
$ ls -l /bin/dash
-rwxr-xr-x 1 root root 109768 Mar 29 2012 /bin/dash
$ ls -l /bin/bash
-rwxr-xr-x 1 root root 959120 Mar 28 2013 /bin/bash
$
Only one thing puzzles me how would one activate a function that was in ~/bashrc ,~/bash_aliases or in a script ?
Remember, "at" is using /bin/sh, not /bin/bash. So /bin/sh is not going to understand those tildes, nor would it ever think to look in bashrc, etc. even if it did understand the tildes ... since it's not bash, it's sh.
peter@peter-Lenovo-G580 ~ $ at now + 2 minutes
warning: commands will be executed using /bin/sh
at> export DISPLAY=:0.0
at> . /home/peter/.bashrc
at> cadno
at> <EOT>
job 354 at Wed Sep 3 08:06:00 2014
I was so tired yesterday I was making all sorts of mistakes.
But I'm trying to get a one liner,this very crude script sort of works
BUT it runs without ANY DELAY WHATSOEVER
Code:
#!/bin/bash
read -p "Enter time:" amser
at $amser
export DISPLAY=:0.0
. /home/peter/.bashrc
cadno
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~ d
"atscript.sh" 7L, 100C 5,1 All
I would say my question is solved ; keefaz and haertig many thanks for patience and excellent help.
I hope by declaring this as solved it would still remain open ,for there are quite a few aspects of
this command that need to be explored ,as the Man Page is not very detailed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.