at warning: commands will be executed using /bin/s

http://www.linuxquestions.org/questions/linux-general-1/at-warning-commands-will-be-executed-using-bin-s-491520/

  #1
RGummi
Member
 
Registered: Nov 2005
Posts: 90

Rep: Reputation: 15
at - warning: commands will be executed using /bin/s


[Log in to get rid of this advertisement]
Hello,

is there a way to switch off the stupid output of at "warning: commands will be executed using /bin/s"? I have tried to send the stderr output to /dev/null, this works but the text with the job number is also send to /dev/null! So I'am looking for a switch to tell at that I dont'need this warning!

Thanks
R
 

RGummi
View Public Profile
View LQ Blog
View Bookmarks
View Review Entries
View HCL Entries
Find More Posts by RGummi

Old 10-12-2006, 07:32 AM  #2
druuna
Senior Member
 
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs
Posts: 4,820

Rep: Reputation: Disabled
Hi,

You need to tell at which shell to use (/bin/s is not a valid shell, you should look into this!)

Use one of the following to tell at which shell to use (if present):
-c C shell. csh(1) is used to execute the at-job.
-k Korn shell. ksh(1) is used to execute the at-job.
-s Bourne shell. sh(1) is used to execute the at-job.

If you do not use one of the above the value of the SHELL variable will be used (which probably points to /bin/s, which is incorrect).

man at for details.

Hope this helps.
 

druuna
View Public Profile
View LQ Blog
View Bookmarks
View Review Entries
View HCL Entries
Find More Posts by druuna

Old 10-12-2006, 12:01 PM  #3
RGummi
Member
 
Registered: Nov 2005
Posts: 90

Original Poster
Rep: Reputation: 15
Hi,

yes you are right! It says "warning: commands will be executed using /bin/sh"
I have tried at -s but it says -s is an invalid option. man at does not say anything about -s, -c -k option.

at -V says
at version 3.1.8


R
 

RGummi
View Public Profile
View LQ Blog
View Bookmarks
View Review Entries
View HCL Entries
Find More Posts by RGummi

Old 10-12-2006, 01:58 PM  #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, Slackware, Slax, Knoppix, SysrescueCD
Posts: 1,328

Rep: Reputation: 49
Here's how I'd do it:
Code:
$ echo 'echo hello >/dev/null' | at now + 2 min >/dev/null 2>&1
This command creates the at job, silently.

Then come back later to investigate what you need:
Code:
$ at -l
$ at -c <jobnumber>
$ atrm <jobnumber>
The first command lists all your current at jobs (jobnumber and time of execution)
The second shows the details of a specific jobnumber
The third deletes a specific jobnumber

[edit]

p.s. - If you want a one-liner that mimics what you are asking to do, here's one:
Code:
echo "echo hello > /dev/null" | at now + 2 min 2>/dev/null; at -l | tail -n1
[/edit]

Last edited by haertig; 10-12-2006 at 02:01 PM.
 

haertig
View Public Profile
View LQ Blog
View Bookmarks
View Review Entries
View HCL Entries
Find More Posts by haertig

Old 10-13-2006, 12:34 PM   #5
RGummi
Member
 
Registered: Nov 2005
Posts: 90

Original Poster
Rep: Reputation: 15
Hi,

thanks!

now I do the following:

echo $cmd | at $time $date 2>&1 | tail -n 1

this is perfect!

RGummi
原文地址:https://www.cnblogs.com/lexus/p/1833426.html