我试图在adb shell上运行linux shell脚本。它给错误! 这里是整个故事:在adb shell上运行linux bash脚本
我写了一个简单的bash脚本hello.sh:
#!/bin/bash
function hello
{
echo "hello world!"
}
hello
运行它作为./hello.sh生产的O/P
hello world!
现在我推送该文件到Android设备使用
adb push hello.sh /data/folder_name
然后运行以下命令进入adb shell
adb shell
亚行壳烧成以下命令
cd /data/folder_name
chmod 755 hello.sh
sh hello.sh
这是我得到亚行外壳:
# sh hello.sh
sh hello.sh
function: not found
hello world!
hello: not found
#
这里发生了什么! 还是有一些不同的方式来编写功能的亚行外壳脚本
我搜索,但没有得到妥善解决 请帮助。
完美!谢谢。:) – 2014-10-10 05:04:44