全文预览

LINUX大作业(北邮信息工程2012年春)(精选)

上传者:学习一点 |  格式:doc  |  页数:13 |  大小:0KB

文档介绍
heck your arguments"Рexit 1Рfi #if 2 , check if the source file exists.РifР[ "$1" = "$2" ]РthenРecho "the source file and the destination is the same file!"Рexit 1Рfi #if 3 , check the amount of the arguments.Рif Рecho "$2" | grep -q '^[a-zA-Z0-9_]\+$'Рthen РcontinueРelse Рecho "your destination is a invalid file name."Рexit 1Рfi #if 4, check if the destination is a invalid file nameРifР[ -f "$2" ]РthenРwhile [ $sign -eq 1 ]РdoРecho "the destination file has been created, are u sure to overwrite it?(please enter y/n)"Рread YesOrNoРcase "$YesOrNo" inРy) Рcp $1 $2Рecho "------------------------------------------"Рecho "the file has been copied"Рsign=0РcontinueР;;РY) Рcp $1 $2Рecho "------------------------------------------"Рecho "the file has been copied"Рsign=0РcontinueР;;Рn) Рsign=0Рbreak

收藏

分享

举报
下载此文档