I am trying tun a shell script from android shell. Please see the output below.
root@user:/data # ./run_script.sh
/system/bin/sh: ./run_script.sh: No such file or directory
root@user:/data # ls -l run_script.sh
-rwxrwxrwx root root 5861 2016-11-14 07:31 run_script.sh
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 partition as well. The result is same. I verified from mount command that both the partitions are not mounted with noexec
flag.
I am able to get it working with sh run_script
but I want to get it working by executing directly.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With