VxRail:脚本错误: bash:./clean_up_esrs.sh:/bin/bash^M:错误的解释器

Summary: 尝试从 VxRail Manager 运行脚本时出现错误: “bash:./clean_up_esrs.sh:/bin/bash^M: bad interpreter:No such file or directory”

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms



尝试在 VxRail Manager CLI 上运行 shell 脚本时,发生以下情况:
 

"bash: ./clean_up_esrs.sh: /bin/bash^M: bad interpreter: No such file or directory"



显示脚本错误的屏幕截图:“bash:./clean_up_esrs,sh:/bin/bash^M: bad interpreter:No such file or directory” 

 

Cause

从 FTP 下载 shell 脚本时,它是 ASCI 格式。脚本需要转换为二进制文件才能与 UNIX 配合使用。

Resolution

  1. 使用具有 ROOT 访问权限的 SSH 登录到 VxRail Manager。
  2. 导航到 shell 脚本的位置,然后在其中执行 vi。

    示例:
vi clean_up_esrs.sh


显示 DOS 格式的脚本屏幕截图,该格式在 VxRail Manager 上不起作用。 
 

提醒:在底部,它应显示 shell 脚本的当前格式。在这种特殊情况下,它显示 shell 脚本在 DOS 中。请记住,VxRail Manager 基于 Linux,这意味着它必须采用 UNIX 格式。
  1. 更改格式以在 BINARY 中工作。在 vi 会话中输入以下命令,然后按 Enter 键。

 

:set ff=unix 



显示在 Vi 编辑器中使用 :set ff=unix filetype 命令的屏幕截图。 

  1. 通过输入以下命令保存文件:
:wq!
  1. 使用 vi 返回 shell 脚本以确保格式已更改(不应在底部看到 DOS)
  2. 尝试再次运行 shell 脚本,现在应该会成功。

    显示脚本在设置文件类型后成功运行的屏幕截图。 
     

Products

VxRail, VxRail Appliance Series, VxRail Software
Article Properties
Article Number: 000025001
Article Type: Solution
Last Modified: 10 Feb 2025
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.