码迷,mamicode.com
首页 > 系统相关 > 详细

shell 判断文件

时间:2017-08-04 16:08:49      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:shell

yuan_file="/home/coservice.war"

if [ ! -f "$yuan_file" ]

   then

       echo "【文件检测fail】$yuan_file不存在,$0退出执行"

       exit 1

   else

       echo "【文件检测ok】$yuan_file存在,$0继续执行"

fi


本文出自 “砖家博客” 博客,请务必保留此出处http://wsxxsl.blog.51cto.com/9085838/1953590

shell 判断文件

标签:shell

原文地址:http://wsxxsl.blog.51cto.com/9085838/1953590

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!