可能重复:
Why am I getting “: No such file or directory” when trying to execute a bash script?
我有以下shell脚本..当运行它时,cd命令会一直失败并出现以下错误..有人提供输入错误吗?
#\!/bin/sh
ANDROID_ROOT="/local/mnt/workspace/AU"
cd $ANDROID_ROOT
source build/envsetup.sh
lunch 12
: No such file or directoryal/mnt/workspace/AU
./test.sh: line 4: build/envsetup.sh: No such file or directory
<username:/local/mnt/workspace/username/scripts>
答案 0 :(得分:1)
线路结尾是蠢的。通过dos2unix
运行它。