I tried this and failed. Does case statements exist in termux?
#!/data/data/com.termux/files/usr/bin/bash
case in "$1"
start)
echo 'var1'
;;
stop)
echo 'var2'
;;
esac
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.
Sign up to join this communityTermux does indeed support case
, but your syntax is incorrect. This, instead, works.
case "$1" in
start)
echo 'var1'
;;
stop)
echo 'var2'
;;
esac
Adding a blank line between the start)
and stop)
blocks is just a stylistic choice.