第三周作业

  写个脚本,完成以下任务:

自动到ftp://192.168.0.254/pub/gls,centos.repo下载到/tmp目录,
判断一此文件是否存在,如果存在,则修改其中的baseurl= http://mirrors.163.com/centos为 http://mirrors.sohu.com/centos

 

 

  1 #!/bin/bash

  2 #Author: Vivid

  3 #Date & Time: 2010-12-21 16:52:02
  4 #Description:第三周作业
  5    
  6    cd /tmp
  7    lftp 192.168.0.254
  8    cd ./pub/gls
  9    get centos.repo
 10    bye
 11    
 12 #判断此文件是否存在于/tmp
 13    if [ -e centos.repo ]; then
 14       ced 's/163/sohu/g' centos.repo
 15    else
 16       echo " The file do not exist! "
 17    fi
~          
 

你可能感兴趣的:(职场,作业,休闲)