LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 784|回复: 1

我的脚本自动创建个文件为什么?(已解决)

[复制链接]
发表于 2009-5-4 19:01:32 | 显示全部楼层 |阅读模式
我的脚本信息如下:
#!/bin/bash
if [ ! -n "$1" ] ; then
echo Err : You not appointed a file!
exit 0
fi

if [ ! -f "$1" ] ; then
        echo "ERR:The $1 not exists or it's not a file"
        exit 0
fi

adr=`sed -n "1p" $1`
Firstr=`expr substr $adr 1 4`
if [ ! -n "$adr" -o "$Firstr" != "mms:" ] ; then

        echo " The $1 not has a correct mms address!"
        exit 0
fi


#if [ "$Firstr" != "mms:" ] ; then
#        echo "The $1 not has acorrect mms address!"
#        echo "$Firstr"
#        exit 0
#fi

echo " The mms address : $adr "

echo " mplayer will play it,please wait for a moment! "
mplayer $adr < /dev/null > /dev/null 2>1&

以上脚本执行完毕后就会在当前目录下创建一个名字为1的普通文件,不知道为什么?
 楼主| 发表于 2009-5-4 19:15:10 | 显示全部楼层
sorry,我找到问题了

最后一句
mplayer $adr < /dev/null > /dev/null 2>&1 &

这样就ok了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表