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

初学Linux之简单的Shell

时间:2016-09-12 14:06:36      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

先占坑,回头补充完善哈

 

#!/bin/bash
# Program:
# This program is used to stop tomcat.
# History:
# 2016/09/11 XH First release
pid=`ps -ef|grep tomcat|grep -v grep|awk ‘{print $2}‘`
if [ $pid ]
then
        echo ‘Tomcat is already running..‘
else

        /opt/tomcat7/bin/startup.sh
        echo ‘Tomcat has just been started..‘
        tail -f /opt/tomcat7/logs/catalina.out
fi

 

pid=`ps -ef|grep tomcat|grep -v grep|awk ‘{print $2}‘`
if [ $pid ]
then
        echo ‘Tomcat is alread running..pid is --> $pid‘
else
        echo ‘Tomcat has just been started..‘
fi

初学Linux之简单的Shell

标签:

原文地址:http://www.cnblogs.com/hywht/p/5864349.html

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