#!/bin/bash
string=””
if [ -z “$string” ];then
echo “string is empty”
fi
if [ -n “$string” ];then
echo “string is not empty”
fi
输出:
string is empty
#!/bin/bash
string=””
if [ -z “$string” ];then
echo “string is empty”
fi
if [ -n “$string” ];then
echo “string is not empty”
fi
输出:
string is empty