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
posted on 2010-09-23 17:35  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2010/09/23/1833426.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值