source和sh
写了一个脚本【xxyScript.sh】,用于判断tomcat是否启动
#!/bin/bash
if [ -z "$(ps -ef | grep tomcat | grep -v 'grep tomcat' | awk -F ' ' '{print $2}'| awk -F ' ' '{print $1}')" ]; then
{
echo "***************************the tomcat has shutdwon , I want to startp it******************************";
sleep 3;
#//home/tomcat/tomA/bin/startup.sh;
echo "****************************the tomcat has startp ,and you can look tomA_log for it************************************";
sleep 3;
#tail -f /home/tomcat/tomA/logs/catalina.out;
}
fi
if [ -n "$(ps -ef | grep tomcat | grep -v 'grep tomcat' | awk -F ' ' '{print $2}'| awk -F ' ' '{print $1}')" ]; then
{
echo "*************************the tomcat is startp************************************";
}
fi


source和sh的更多相关文章
- linux里source、sh、bash、./有什么区别
在linux里,source.sh.bash../都可以执行shell script文件,那它们有什么不同吗? ----------- 1.source source a.sh 在当前shell内去读 ...
- shell中source与sh区别
shell中使用source conf.sh,是直接运行conf.sh的命令,不创建子shell,类似与html中include,而sh是则创建子shell, 子shell里面 的变量父shell无法 ...
- source 和sh 区别
sh新建一个子shell进程,变量在主shell中无法获取 source在当前shell中执行脚本,变量在主shell即当前shell中可以获取 例子: 1.新建一个test.sh脚本,内容为:A=1 ...
- source、sh、bash
source.sh.bash../ 执行脚本的区别 1.source命令用法: source FileName 作用:在当前bash环境下读取并执行FileName中的命令.该filename文件可以 ...
- linux里source、sh、bash、./有什么区别(转)
add by zhj: 主要不同是,source是在当前shell中执行脚本,而sh, bash, ./是在当前shell的child shell中执行脚本 原文:http://www.cnblogs ...
- [Shell Script]关于source和sh对于脚本执行不同
当我修改了/etc/profile文件,我想让它立刻生效,而不用重新登录:这时就想到用source命令,如:source /etc/profile对source进行了学习,并且用它与sh 执行脚本进行 ...
- (转)source、sh、bash、./执行脚本的区别
source.sh.bash../执行脚本的区别 原文:https://www.cnblogs.com/sparkbj/p/5976100.html 1.source命令用法: source Fil ...
- ./test.sh . ./test.sh source ./test.sh的区别
背景 今天写几个shell脚本,使用一个公共的config.sh,但是export出来的东西在另外的*.sh中不能直接用,这让我很惆怅,印象中就是可以export出来给别的shell用啊,只要不是下一 ...
- source和sh执行脚本时的差异
在CentOS7下,有如下脚:sh02.sh. 1 用sh或者bash执行 先执行echo $firstname $lastname 再执行 sh sh02.sh 最后执行 echo $firstna ...
- source、sh、./执行脚本对变量的影响
shell脚本中的变量: local一般用于局部变量声明,多在在函数内部使用. shell脚本中定义的变量是global的,其作用域从被定义的地方开始,到shell结束或被显示删除的地方为止. she ...
随机推荐
- PostgreSQL的backuplabel file 初步学习
磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面:PostgreSQL内部结构与源代码研究索引页 回到顶级页面:PostgreSQL索引页 看代码: /* File path names ...
- python基础学习1-装饰器在登陆模块应用
LOGIN_USER ={"islogin":False} def outer(func): def inner(*args,**kwargs): if LOGIN_USER[&q ...
- 使用Python代码处理Excel
转载说明: 原文地址:http://my.oschina.net/alazyer/blog/223354 原文有十处左右的错误,修正后转载于此. 经验证,python 3.4.3下可用.请各位朋友明察 ...
- 用CSS中的Alpha实现渐变
效果一:<div id="Layer1" style="position:absolute; left:161px; top:160px; width:2 ...
- Async方法死锁的问题 Don't Block on Async Code(转)
今天调试requet.GetRequestStreamAsync异步方法出现不返回的问题,可能是死锁了.看到老外一篇文章解释了异步方法死锁的问题,懒的翻译,直接搬过来了. http://blog.st ...
- 解决shell命令"** is not in the sudoers file..."错误
Linux中新建的普通用户一般不会分配给root权限,每次都su root也太麻烦,可以通过在/etc/sudoers文件中添加当前用户的方式,给当前用户赋予sudo命令的使用权限. # 切换到roo ...
- WebGL——osg框架学习四
这篇我们接着来看一下DrawEntityActor类,我们来看看这个继承DrawActor的类到底做了什么事.我们之前学习了Drawable对应的DrawActor,那么我们类比的来看Drawable ...
- NAT概念解释(不完全版,但不会搞错...)
NAT在计算器网络中,网络地址转换(Network Address Translation,缩写为NAT),也叫做网络掩蔽或者IP掩蔽(IP masquerading)是一种IP数据包在通过路由器或防 ...
- shell小记
1.以#!/bin/bash 开头2.执行方式 bash sh ./ `script`3.变量: 系统变量 自定义变量 --->export 可导出为全局环境变量 set显示所 ...
- HackRF 无线门铃信号录制与重放
本文内容.开发板及配件仅限用于学校或科研院所开展科研实验! 淘宝店铺名称:开源SDR实验室 HackRF链接:https://item.taobao.com/item.htm?spm=a1z10.1- ...