can't source script in a current directory

后端 未结 3 852
不思量自难忘°
不思量自难忘° 2021-01-04 19:03

So apparently, I can\'t source a script if that script is in the current directory. For example,

# source some/dir/script.sh
Ok
<
3条回答
  •  温柔的废话
    2021-01-04 19:37

    This can happen when the file is in the wrong format. I FTP'd a Korn Shell script from Windows. I could edit it, but got "not found [No such file or directory]" when I tried to run it. It turned out it was in DOS format, which was indicated in the file name line when I edited it in vi. After I re-FTP'd it, making sure it was being transferred as ASCII, it ran fine.

提交回复
热议问题