shell script in android gives [: not found

前端 未结 8 1507
一个人的身影
一个人的身影 2021-01-20 23:31

I have this script which works on my linux machine

#!/bin/sh
c=1
if [ $c == 1 ]
then
  echo c is 1
else
  echo c is 0
fi

But when I use this in

8条回答
  •  青春惊慌失措
    2021-01-21 00:13

    I run into this issue also and found a solution (on another site)

    if [[ $b -gt 0]]
    then
        echo 'Hooray it works'
    else
        echo 'still works'
    fi
    

提交回复
热议问题