Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
09-02-2014, 01:12 PM
|
#16
|
Member
Registered: Feb 2011
Location: Wales
Distribution: MX Linux 18
Posts: 36
Original Poster
Rep:
|
Quote:
In your .bashrc, in cadno function try to write the full path to radiotray just in case.
eg
Code:
cadno () {
/usr/bin/radiotray url goes here
}
|
Nothing happening !
|
|
|
09-02-2014, 01:19 PM
|
#17
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
I see one problem right here:
Code:
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
$
|
|
|
09-02-2014, 01:23 PM
|
#18
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
Quote:
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.
|
|
|
09-02-2014, 01:41 PM
|
#19
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,858
|
Quote:
Originally Posted by haertig
Do not assume that /bin/sh points to /bin/bash. On my system it does not:
|
Good point, I didn't think of that
lwv962, instead of source .bashrc, use . (dot)
Code:
. /home/peter/.bashrc
|
|
|
09-03-2014, 05:56 AM
|
#20
|
Member
Registered: Feb 2011
Location: Wales
Distribution: MX Linux 18
Posts: 36
Original Poster
Rep:
|
Whew !
This does work :
Code:
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.
|
|
|
09-03-2014, 08:16 AM
|
#21
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,858
|
Quote:
Originally Posted by lwv962
BUT it runs without ANY DELAY WHATSOEVER
|
Your script doesn't pass the commands that follows at line to at...
What it does is run "at" at specified time with no command, and execute commands following at lines
try:
Code:
#!/bin/bash
read -p "Enter time:" amser
at $amser <<END
export DISPLAY=:0.0
. /home/peter/.bashrc
cadno
END
|
|
1 members found this post helpful.
|
09-03-2014, 09:07 AM
|
#22
|
Member
Registered: Feb 2011
Location: Wales
Distribution: MX Linux 18
Posts: 36
Original Poster
Rep:
|
Thanks keefaz ,
I messed that one !! Btw I've found this works without functions:
Code:
#!/bin/bash
r4= /usr/bin/radiotray http://.......
insp= /usr/bin/radiotray url or whatever the link is
they can be called from the CLI. as one did with the function.
BUT your sanitised version of my script allied with that list
file makes the use of a function unnecessary.
I don't what you think but "A HOW TO " on 'at" would be handy !?
|
|
|
All times are GMT -5. The time now is 04:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|