DISPLAY_HEADER=1
if [ "$1" != "test" -o "$1" != "test2" ]
then
if [ $DISPLAY_HEADER == 1 ]; then
DISPLAY_HEADER=0
echo "sdasa "
echo $1
fi
fi
它的显示 sdasa 和 -o 不工作?
怎么了?
最佳答案
你可以使用 case/esac
case "$1" in
test|test2)
# do something
*)
# set display data
;;
esac
关于linux - shell 脚本 -o 操作不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3438671/