Linux Shell中判断某个环境变量是否存在以及获取某个环境变量的值
来源:互联网 发布:php幸运大转盘源码 编辑:程序博客网 时间:2024/04/28 10:48
Shell中判断某个环境变量是否存在以及获取某个环境变量的值
#!/bin/bash
if [ $TOMCAT_HOME ];
then
echo "not found "
else
tar xvf /home/a.tar
fi
echo $TMPPATH #直接用'#'+环境变量名在shell中使用环境变量的值
if [ -z $TMPPATH ] ; then
echo "no tmppath "
else
...
fi
-z 是检查字符串是否为空
检查文件为空用 -s来判断
-a file True if file exists.
-d file True if file exists and is a directory.
-f file True if file exists and is a regular file.
-n string True if the length of string is non-zero.
string1 == string2 True if the strings are equal.
string1 != string2 True if the strings are not equal.
string1 < string2 True if string1 sorts before string2 lexicographi
简单明了的shell bash脚本文件生成介绍: http://blog.sina.com.cn/s/blog_633fdd420100pnt4.html
- Linux Shell中判断某个环境变量是否存在以及获取某个环境变量的值
- Linux Shell 判断环境变量 是否存在
- 判断List中是否存在某个值
- shell 脚本判断某个文件是否存在
- 通过svnkit,获取最新的revision以及判断某个revsion是否存在
- 如何在Shell中通过脚本判断某个服务是否存在的解决方法
- 判断环境变量是否存在
- 判断数据库中是否存在某个表
- 判断dataset中是否存在某个表?
- 判断ACCESS中是否存在某个表
- 判断字符串中是否存在某个字符
- 判断应用中某个activity是否存在
- sqlite 中判断某个表是否存在的方法
- jquery判断字符串中是否存在某个的字符串
- jquery判断字符串中是否存在某个的字符串
- linux shell 脚本判断某个文件是否有某个字符串以及统计含有某个字符串的个数然后做if else大于小于等于逻辑判断
- oracle regexp_like实现字符串中判断某个值是否存在
- PHP判断字符串str中是否存在某个值
- 递归
- 【ORACLE】oracle9i/10g/11g各种下载
- mssql 数据库还原
- 获取每一帧的长度
- shell排序 类似于插入排序
- Linux Shell中判断某个环境变量是否存在以及获取某个环境变量的值
- mysql 命令
- python之异常处理
- VC++/MFC 小程序 文件/目录对话框 递归遍历文件/文件夹
- 一些iOS高效开源类库
- 快速排序
- Oracle数据库中关键字
- DIV+CSS开发浏览器的兼容性
- 小型ERP开发