Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我做:
while [ $choice != 'X' ] do
它有效,但当我这样做时
while [ $choice != 'x' ] || [ $choice != 'X' ] do
它们都不起作用。
任何想法?
man test
EXPRESSION1 -o EXPRESSION2 either EXPRESSION1 or EXPRESSION2 is true
while [ $choice != 'x' -o $choice != 'X' ]
请注意,此表达式始终为真,您想要and:-a吗?
and
-a
如果你用它替换||它&&也会工作..
||
&&