shell脚本在终端中执行,但不是双击ubuntu

时间:2013-12-06 14:25:18

标签: shell ubuntu

所以我的桌面上有一个shell脚本,当它在终端中运行时会完美执行: pullADB.sh

但是当我尝试双击它时,这会崩溃。 代码:

#!/bin/bash

adb pull /sdcard/MovingGratings         ~/Documents/AndroidData/MovingGratings
adb pull /sdcard/LoomingDot             ~/Documents/AndroidData/LoomingDot
adb pull /sdcard/LuminanceCalibrate     ~/Documents/AndroidData/LuminanceCalibrate
adb pull /sdcard/LuminanceContrast      ~/Documents/AndroidData/LuminanceContrast
adb pull /sdcard/MovingDot              ~/Documents/AndroidData/MovingDot  
adb pull /sdcard/MovingGratings         ~/Documents/AndroidData/MovingGratings
adb pull /sdcard/DCIM/Camera            ~/Documents/AndroidData/Camera

$SHELL

error: 
/home/XXX/Desktop/pullADB.sh: line 4: adb: command not found

this repeats each time the script tries to call adb.

任何想法?

提前感谢!!

1 个答案:

答案 0 :(得分:0)

找不到程序adb

程序所在终端的时间:

which adb

然后将脚本中的adb调用替换为这些值,例如:

/usr/bin/adb pull /sdcard/MovingGratings         ~/Documents/AndroidData/MovingGratings
/usr/bin/adb pull /sdcard/LoomingDot             ~/Documents/AndroidData/LoomingDot
...