mk.. mk.. - 1 year ago 84
Linux Question

Unable to execute a shell script in android shell

I am trying tun a shell script from android shell.
Please see the output below.

root@user:/data # ./
/system/bin/sh: ./ No such file or directory

root@user:/data # ls -l
-rwxrwxrwx root root 5861 2016-11-14 07:31

Why is it saying "No such file or directory" The error is strange as the file is actually present.

I tried copying the same shell script to /system parition as well. The result is same. I verified from ount command that both the partitions are not mounted with

I am able to get it working with
sh run_script
but I want to get it working by executing directly.

Answer Source

Usually this happens when a shebang is not correct. Check if you have a "#!..." at the start of the script and remove it or correct it

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download