Chinaunix首页 | 论坛 | 博客
  • 博客访问: 328919
  • 博文数量: 105
  • 博客积分: 358
  • 博客等级: 一等列兵
  • 技术积分: 444
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-25 23:00
个人简介

爱生活,爱养生 www.sijiyang.com 欢迎朋友来友联

文章分类

全部博文(105)

文章存档

2017年(2)

2016年(2)

2014年(24)

2013年(34)

2012年(39)

2011年(4)

分类: LINUX

2011-12-27 15:46:11

#!/bin/bash
#作者:罗宏江
#QQ:123769752
#mail:g_linux@qq.com
#原创---请你转载说明出处,请支持别人的劳动成果。
declare -i rstog stog
rstog=0
stog=0
>sdf_error.log
IP="
132.225.129.999
"
if (( $# == 0 ));then   #检查输入的参数,是不是正确的。
 echo "Format: $0 [sourcefile -remotefile],[-remotefile sourcefile]"
   exit
fi
while (( $# ))
do
{
        if [[ ! -e $1 ]];then  # 判断不是文件
        {       rstog=$rstog+1
                rmpath=$1
                rmpath=${rmpath:1}
                shift
         
                if [[ ! -e $1 ]];then # 判断不是文件
                {                 
                   echo "nofile">sdf_error.log                       
                                
                    
                 }
                  else
                 {
                  stog=$stog+1
                  file=$1
                  shift
                  }   
                fi
                
                
           }  
           else
           {
            stog=$stog+1
            file=$1
            shift
           }   
          fi
 
}
done
if (( $stog <= 1 && $rstog <= 1 ));then
for i in ${IP[*]}
{
       
          scp -r $file &
}
fi
阅读(1425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~