17 lines
258 B
Bash
17 lines
258 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# -r 防止特殊字符被转义,例如 \n
|
||
|
read -r pwd1
|
||
|
read -r pwd2
|
||
|
|
||
|
echo "$pwd1 is zero string?"
|
||
|
[ -z "$pwd1" ]
|
||
|
echo $?
|
||
|
|
||
|
[ "$pwd1" = "$pwd2" ]
|
||
|
if [ $? -eq 0 ]
|
||
|
then
|
||
|
echo "pwd1 is equal to pwd2"
|
||
|
else
|
||
|
echo "pwd1 is not equal to pwd2"
|
||
|
fi
|