Android Shell Syntax error: ‘fi’ unexpected

I try to run following Bash Code on my Android 5.1 Terminal (rooted, bussybox) but getting the error

Syntax error: 'fi' unexpected

The code:

if [ $api -lt 14 ]; then
    run=/data/data/com.googlecode.android_scripting/files/run_pie
    if ! [ -x $run ]; then
        echo "need root permission to launch run_pie/python"
        ls -l "$run"
        su -c "$run $bin/bin/python $*"
    else
        $run $bin/bin/python $*
    fi
else
    $bin/bin/python $*
fi

I’m not advanced using bash! I follow up some bash tutorials, searching for the error but I can’t find the failure?!


Source: bash

Leave a Reply