正确做法:
#!/bin/sh
STRING=
if [ -z "$STRING" ]; then
echo "STRING is empty"
fi
if [ -n "$STRING" ]; then
echo "STRING is not empty"
fi
root@james-desktop:~# ./zerostring.sh
STRING is empty
-------------------------------------------------------------------------