shell脚本在终端中执行,但不需要双击ubuntu
因此,我的桌面上有一个shell脚本,当它在终端中运行时,它可以完美地执行: Pullab.sh 但当我试图双击它时,它就崩溃了。 代码: 有什么想法吗shell脚本在终端中执行,但不需要双击ubuntu,shell,ubuntu,Shell,Ubuntu,因此,我的桌面上有一个shell脚本,当它在终端中运行时,它可以完美地执行: Pullab.sh 但当我试图双击它时,它就崩溃了。 代码: 有什么想法吗 提前谢谢 找不到程序adb 在程序所在的终端中确定: which adb 然后用这些值替换脚本中的adb调用,对于exmaple: /usr/bin/adb pull /sdcard/MovingGratings ~/Documents/AndroidData/MovingGratings /usr/bin/adb pull
提前谢谢 找不到程序
adb
在程序所在的终端中确定:
which adb
然后用这些值替换脚本中的adb
调用,对于exmaple:
/usr/bin/adb pull /sdcard/MovingGratings ~/Documents/AndroidData/MovingGratings
/usr/bin/adb pull /sdcard/LoomingDot ~/Documents/AndroidData/LoomingDot
...
谢谢现在可以了。我只是不明白为什么它通过在终端窗口中运行文件来工作,但需要双击adb程序的显式完整路径。有什么想法吗?这是因为搜索程序的环境变量是
$PATH
。双击脚本时,此变量中并非所有路径都与终端中的路径相同。
/usr/bin/adb pull /sdcard/MovingGratings ~/Documents/AndroidData/MovingGratings
/usr/bin/adb pull /sdcard/LoomingDot ~/Documents/AndroidData/LoomingDot
...