在实际中,需要在构建项目中启动tomcat,也就是需要一个脚本文件
在home目录新建shell文件夹,存放各种脚本文件
就然后编写脚本
tomcat启动脚本
#!/bin/bash
source ~/.bash_profile
NUM=1
TOMCAT_HOME=/home/tomcat/tomcat_test/tomcat_test
for ((i=1;i<=${NUM};i++));
do
echo “$TOMCAT_HOME/tomcat$i is starting..”
cd ${TOMCAT_HOME}$i/bin
sh startup.sh
sleep 1
done
exit 0
命名test_startup.sh