Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

/usr/bin/env: ‘bash ’: No such file or directory

This is a line endings issue, but not from Ubuntu. Make sure you do have node and npm installed correctly by using the command:

sudo apt install nodejs npm

Then stop Windows path variables being shared with WSL by editing the /etc/wsl.conf file in WSL. If the file doesn't exist, execute sudo touch /etc/wsl.conf first. Edit the file with the command sudo nano /etc/wsl.conf and add the following configuration:

# Wsl.conf
[interop]
appendWindowsPath = false

Then restart WSL2 with command wsl --shutdown in Windows(Powershell or CMD).
Comment

/usr/bin/env: ‘bash ’: No such file or directory

# The error message suggests that the script you're invoking has embedded 
 characters,
# which in turn suggests that it has Windows-style 
 line endings instead of the 
-only
# line endings bash expects.
# As a quick fix, you can remove the 
 chars. as follows:
sed $'s/
$//' ./install.sh > ./install.Unix.sh
Comment

env: sh : No such file or directory

Go inside android directory and run:
dos2unix ./gradlew
Comment

/usr/bin/env: bash No such file or directory

Docker on Windows: /usr/bin/env: bash
 No such file or directory
Getting the following error when you want to start your Docker container on Windows: /usr/bin/env: bash
 : No such file or directory

[edit]
I discovered that another fix is to do dos2unix <file>

dos2unix <file with the issues>
Try that if you’re on Windows or working with others who work on Windows.

[/edit]
I found several topics with several fixes. But what fixed it for me was:

Solution: Setting the line-endings correctly

In my editor: 

In git: git config --global core.autocrlf false
I chose the 
 line ending as this is stated in PSR-12: 2.2 Files:
All PHP files MUST use the Unix LF (linefeed) line ending only.

I use PHPStorm and had to go to
Settings > Editor > Code Style > tab General > Unix and macOS (
)


NOTE: you may have to do the following to fix files with the wrong line-endings:

remove the built Docker image on Windows: first list docker images and then delete: docker rmi <imagename>
fix the line-ending of the file. You might do that by removing the newline and adding a new one. Don’t forget to save, commit and push
Comment

/usr/bin/env: ‘bash ’: No such file or directory

sed $'s/
$//' ./install.sh > ./install.Unix.sh
Comment

PREVIOUS NEXT
Code Example
Shell :: xcrun: error: invalid active developer path 
Shell :: Package signatures do not match previously installed version; ignoring! 
Shell :: batch delete all folders and files 
Shell :: get date whit batch 
Shell :: add group linux 
Shell :: install vault 
Shell :: chocolatey local installed 
Shell :: ubuntu find text in files 
Shell :: commitlint install 
Shell :: rename github repository command line 
Shell :: git push local repo to remote 
Shell :: terminal delete directory 
Shell :: open current folder in terminal linux 
Shell :: how to mount a flash drive in wsl 
Shell :: linux up one directory 
Shell :: bash iterate over a variable range of numbers 
Shell :: how to open file in linux 
Shell :: comparing file content bash 
Shell :: semantic ui react npm install 
Shell :: how switching in git branches 
Shell :: bash replace specific line in file 
Shell :: docker build from github repository 
Shell :: git clone with long file names 
Shell :: list files in cmd 
Shell :: remove pod and install again 
Shell :: gtest filter command line 
Shell :: sed extract string between two patterns 
Shell :: download influxdb for windows 
Shell :: install rtools rstudio 
Shell :: order allow deny 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =