小编Amr*_*mel的帖子

无法满足shell脚本中的if条件

我试图在下面执行以下 shell 脚本

function Check_Status () {

       if [[ "$(adb shell getprop sys.boot_completed)" =~ "adb: no devices/emulators found" ]]; 
       then
          echo "here"

       else 
            echo "im here"
       fi;
};

Check_Status
Run Code Online (Sandbox Code Playgroud)

我得到以下输出,我期待看到“这里”而不是“我在这里”

截屏

不确定会丢失什么

linux bash shell-script adb

0
推荐指数
1
解决办法
43
查看次数

标签 统计

adb ×1

bash ×1

linux ×1

shell-script ×1