root@vladimir-Virtual-Machine:~# bash ./bash.sh –a –b –c –d ./bash.sh: строка 2:…
- User
root@vladimir-Virtual-Machine:~# bash ./bash.sh –a –b –c –d ./bash.sh: строка 2: 'echo\r': команда не найдена ./bash.sh: строка 5: синтаксическая ошибка рядом с неожиданным маркером «'in\r'» '/bash.sh: строка 5: `case "$1" in
- Assistant
It seems that there are some issues with the line endings in the script file. The error messages suggest that there are some extra carriage returns (
\r) in the script, which can cause problems in the execution.To fix this, you can try opening the file in a text editor that supports UNIX line endings (LF), such as Notepad++ or Sublime Text, and converting the line endings to LF. Alternatively, you can try running the
dos2unixcommand on the file to convert the line endings to UNIX format:dos2unix bash.shThis should remove any extra carriage returns and fix the script so that it can be executed without errors.