1.判断字符串为空 if [ -z "$str" ]; then echo "empty string" fi 2.判断文件是否存在 if [ -f /home/builder/.profile ]; then echo "File exists;" fi 3.逻辑非 if [ ! -f /home/builder/.bash_profile ]; then echo "here!"else echo "te
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA SQL字符串连接操作 前言部分 大家可以关注我的公众号,公众号里的排版更好,阅读更舒适. 正文部分 把多个字符串连接起来,在HANA SQL里这样写 关键字:concat )) as begin declare cursor C for SELECT OITM.”ItemName” from OITM;
最近发现使用 -z 和 -n 来判断字符串判空,或不空时,很不靠谱. 使用下面的方法最可靠: if [ "x${value}" == "x" ] #为空 then #为空处理 fi if [ "x${value}" != "x" ] #不为空 then #不为空处理 fi 转自 Shell脚本中字符串判空:使用-z 字符串长度为0时,为真,-n字符串长度不为0,为