小编use*_*466的帖子

if语句shell脚本中的多个条件

我想知道在if编写shell脚本时是否可以在语句中包含两个以上的语句?

username1="BOSS1"
username2="BOSS2"
password1="1234"
password2="4321"

if(($username == $username1)) && (($password == password1)) || 
  (($username == $username2)) && (($password == password2)) ; then
Run Code Online (Sandbox Code Playgroud)

这不起作用.但有没有办法让它发挥作用?

谢谢!

account shell conditional if-statement

6
推荐指数
2
解决办法
10万
查看次数

标签 统计

account ×1

conditional ×1

if-statement ×1

shell ×1