美文网首页Linux研究所
关于shell脚本提示No such file or direc

关于shell脚本提示No such file or direc

作者: 百里江山 | 来源:发表于2020-04-22 14:36 被阅读0次

在window环境下编写的一个shell脚本, 在linux下无法运行, 报: No such file or directory 错误.

使用file命令用于辨识文件类型

file build.sh
显示如下信息. 无法在linux下运行
build.sh: a /usr/bin/env bash\015 script, ASCII text executable, with CRLF line terminators

解决方法

vim build.sh
# 设置成unix
:set ff=unix 

验证文件信息

file build.sh
a /usr/bin/env bash script, ASCII text executable

相关文章

网友评论

    本文标题:关于shell脚本提示No such file or direc

    本文链接:https://www.haomeiwen.com/subject/uisiihtx.html