Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/env: ‘bash\r’: No such file or directory [duplicate]

I am having an issue after setting up docker in Linux terminal in win10. When I am trying to build it shows following error.

/usr/bin/env: ‘bash\r’: No such file or directory
ERROR: Service 'magento2' failed to build: The command '/bin/sh -c /opt/docker/bin/service.d/autosync.sh install     && docker-service-enable autosync' returned a non-zero code: 127

Is it git line ending bug and how can I solve it?

like image 256
Priyal Avatar asked Apr 18 '19 06:04

Priyal


People also ask

What does usr bin env bash mean?

As we mentioned earlier,#!/usr/bin/env bash is also a shebang line used in script files to execute commands with the Bash shell. It uses the env command to display the environment variables present in the system and then execute commands with the defined interpreter.


2 Answers

In VSCODE you can use: VSCODE Editor Bar

LF can be changed in CRLF and back

like image 179
adl_B Avatar answered Sep 18 '22 15:09

adl_B


I solved it by finding that autosync.sh somewhere in my projects hidden and changed file format to Unix and boom it worked.

like image 33
Priyal Avatar answered Sep 16 '22 15:09

Priyal