【发布时间】:2012-06-12 00:22:17
【问题描述】:
对不起我的英语。
我写 bash 文件,它使用变量:shared_var=/system/xbin
我的脚本文件:
exec="./adb shell chmod 644 $shared_var/$2"
echo $exec
$exec
让我们运行这个脚本:
>bash gapp.sh misc su
./adb shell chmod 644 /system/xbin/su
: No such file or directory n/su
让我们在没有脚本的情况下运行字符串“./adb shell chmod 644 /system/xbin/su”:
> ./adb shell chmod 644 /system/xbin/su
(No output, OK)
我有几个问题:
- 为什么终端中的脚本和直接输入会有不同的结果?
- 为什么 adb 不是“没有这样的文件或目录 /system/xbin/su”而是返回“没有 soch 文件或目录 n/su”(adb 结果看起来失真)
- 我的问题有什么解决方案?
【问题讨论】:
-
另外,请参阅BashFAQ/050。
标签: android linux bash shell adb