Sample Header Ad - 728x90

./shell.sh: line 6: [: =~: binary operator expected

0 votes
1 answer
6110 views
I'm trying to execute the following shell script, where I'm trying to keep executing a command in an infinite loop and until the output is not equal to a certain substring checkDeviceStatus=$(adb shell getprop sys.boot_completed 2>&1) function Check_Status () { while [ ! "$checkDeviceStatus" =~ "device offline" ] || [ ! "$checkDeviceStatus" =~ "device still authorizing" ] do if [ ! "$checkDeviceStatus" =~ "device offline" ] || [ ! "$checkDeviceStatus" =~ "device still authorizing" ]; then echo "Device is now up and running!!: '$checkDeviceStatus'" break else echo "'$checkDeviceStatus'" fi; done }; Check_Status but I'm getting the following error ./shell.sh: line 6: [: =~: binary operator expected ./shell.sh: line 8: [: =~: binary operator expected
Asked by Amr Kamel (121 rep)
Jul 19, 2021, 02:42 PM
Last activity: Jul 19, 2021, 03:28 PM