#!/bin/sh
A=
"$1"
B=
"$2"
echo
"输入的原始值:A=$A,B=$B"
if
[
"$A"
=
"$B"
];
then
echo
"[ = ]"
fi
if
[
"$A"
==
"$B"
];
then
echo
"[ == ]"
fi
if
[[
"$A"
== a* ]];
then
echo
"[[ ==a* ]]"
fi
if
[[
"$A"
==
"a*"
]];
then
echo
"==/"
a*/
""
fi
if
[
"$A"
== a* ];
then
echo
"[ ==a* ]"
fi
if
[
"$A"
==
"a*"
];
then
echo
"==/"
a*/
""
fi
if
[
"$A"
!=
"$B"
];
then
echo
"[ != ]"
fi
if
[[
"$A"
!=
"$B"
]];
then
echo
"[[ != ]]"
fi
if
[ -n
"$A"
];
then
echo
"[ -n ]"
fi
if
[ -z
"$A"
];
then
echo
"[ -z ]"
fi
if
[ $A /< $B ];
then
echo
"[ < ]"
fi
if
[[ $A < $B ]];
then
echo
"[[ < ]]"
fi
if
[ $A /> $B ];
then
echo
"[ > ]"
fi
if
[[ $A > $B ]];
then
echo
"[[ > ]]"
fi
posted on 2015-09-15 14:52
xzc 阅读(1983)
评论(1) 编辑 收藏 所属分类:
linux/unix