分页: 1 / 1

at 命令怎么用?(okay)

发表于 : 2007-06-07 17:50
iblicf
我总是忘了煤气灶上烧的水,壶已经变形了

刚才想自制一个闹钟:

代码: 全选

weiyh@MyPC: at now + 10 minutes mplayer ~/Examples/ubuntu\ Sax.ogg 
syntax error. Last token seen: m
Garbled time
怎么也搞不定,。。。是不是at 有bug???????

发表于 : 2007-06-07 18:00
iblicf
crontab 可以

发表于 : 2007-06-07 19:52
iblicf
没有人关心我的壶?

发表于 : 2007-06-07 21:33
thword
$ at now + 10 minutes
at> mplayer ~/Examples/ubuntu\ Sax.ogg
at> #输入Ctrl+D

发表于 : 2007-06-08 0:43
iblicf
thx ,不过这么弄比cron还麻烦了,,不用它了

发表于 : 2007-06-08 9:39
eexpress
at有他的好处的。自动清除,适合一次使用的场合。时间格式非常人性和灵活。要不为什么会存在呢?

发表于 : 2007-06-09 23:29
iblicf
'echo "/mplayer ~/Examples/ubuntu\ Sax.ogg" | at now + 10 minutes
我试了一下,这样可以,那就能弄成alias 了,, :)

发表于 : 2007-06-09 23:58
antonym55
iblicf 写了:没有人关心我的壶?
换个有哨的壶

发表于 : 2008-03-17 2:20
zanpen2000
antonym55 写了:
iblicf 写了:没有人关心我的壶?
换个有哨的壶
哈哈,好办法!

Re: at 命令怎么用?(okay)

发表于 : 2009-09-09 10:05
bzhao
iblicf 写了:我总是忘了煤气灶上烧的水,壶已经变形了

刚才想自制一个闹钟:

代码: 全选

weiyh@MyPC: at now + 10 minutes mplayer ~/Examples/ubuntu\ Sax.ogg 
syntax error. Last token seen: m
Garbled time
怎么也搞不定,。。。是不是at 有bug???????
use the command format like this:
create a file and put your command in it. and then run command:
$at now + 10 minutes -f a_file

顺便: 忘了煤气灶上水壶很危险,因为煤气瓶子如果温度太高就会 Boon Boon.... 建议你买个温度煤气报警器。

//if you still have the same issue
//run command as below
$ pstree |grep atd || sudo /etc/init.d/atd start
//then try what you have done again

Re: at 命令怎么用?(okay)

发表于 : 2009-09-09 10:11
c\nc
这种简单要求,弄个sleep就行了吧:

sleep 300 && ...

Re: at 命令怎么用?(okay)

发表于 : 2009-09-10 19:04
tusooa

代码: 全选

>> cat ~/bin/timetools           
#!/bin/bash                      
#                                
x="false"                        
[ -z $1 ] && x="true"            
[ -z $2 ] && x="true"            
[ -z $3 ] && x="true"            
function help                    
{                                
    echo "用法:timetools [ 小时 分钟 秒 ] [ -h | --help ]"
}                                                          
case $1 in                                                 
    -h)                                                    
        help                                               
        exit 0;;                                           
    --help)                                                
        help                                               
        exit 0;;                                           
    [0-9][0-9])                                            
        hr=$1;;                                            
    [0-9])                                                 
        hr="0$1" #一位数处理                               
        ;;                                                 
    *)                                                     
        if [ "$x" = "false" ] ; then                       
            echo '用法错误!'                              
            help                                           
            exit 1                                         
        fi;;                                               
esac                                                       

case $2 in
    [0-9][0-9])min=$2;;
    [0-9])min="0$2";;  
    *)                 
        if [ "$x" = "false" ] ; then
            echo '用法错误!'       
            help                    
            exit 1                  
        fi;;                        
esac                                
case $3 in                          
    [0-9][0-9])sec=$3;;             
    [0-9])sec="0$3";;               
    *)                              
        if [ "$x" = "false" ] ; then
            echo '用法错误!'       
            help                    
            exit 1                  
        fi;;                        
esac                                
if [ "$x" = "true" ] ; then         
    echo "输入小时: "               
    read hr                         
    case $hr in                     
    [0-9][0-9]);;                   
    [0-9])                          
        hr="0$hr" #一位数处理       
        ;;                          
    *)                              
        if [ "$hr" != "" ] ; then   
            echo '用法错误!'       
            help                    
            exit 1                  
        fi;;                        
esac                                

    echo "输入分钟: "
    read min
    case $min in
    [0-9][0-9]);;
    [0-9])min="0$min";;
    *)
        if [ "$min" != "" ] ; then
            echo '用法错误!'
            help
            exit 1
        fi;;
    esac
    echo "输入秒:   "
    read sec
    case $sec in
    [0-9][0-9]);;
    [0-9])sec="0$sec";;
    *)
        if [ "$sec" != "" ] ; then
            echo '用法错误!'
            help
            exit 1
        fi;;
    esac
fi
t="$hr:$min:$sec" # 't' is chort of 't'ime
while : ; do
    ct=`date +%k:%M:%S` # 'ct' is chort of 'c'urrent 't'ime
    if [ "$t" = "$ct" ] ; then
        break
    fi
    sleep 1
done
kdialog --msgbox "计时结束"
#dialog --msgbox "计时结束" 10 10
exit 0