【问题标题】:cd to directory not working in shell script [duplicate]cd 到在 shell 脚本中不起作用的目录 [重复]
【发布时间】:2013-01-02 07:31:43
【问题描述】:

可能重复:
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>

【问题讨论】:

  • 您尝试在命令提示符下执行 cd 吗?另外,删除第一行中的 \。

标签: shell


【解决方案1】:

行尾被搞砸了。通过dos2unix 运行它。

【讨论】:

  • 是的,你是对的,我只是想通了..thnaks
猜你喜欢
  • 1970-01-01
  • 2020-02-26
  • 1970-01-01
  • 2021-10-04
  • 2018-01-19
  • 1970-01-01
  • 1970-01-01
  • 2021-02-08
  • 2020-03-29
相关资源
最近更新 更多