Windwos /usr/bin/env: ?bash?: No Such File Or Directory

This question already has an answer here:.2 answersI'm using following script on linux server. And which is giving:: not found No such file or directoryThis is the script: # -# K.Sugunan Host health check# Description## This script to initiate health check on servers.# It will check for CPU, memory and some connectivity with# up stream and down stream system.## -# Applying initial variables and loading config parametersDOCROOT=$(pwd)'/'TIMENOW=$(date +'%Y-%m-%d%H:%M:%S')echo $DOCROOT. $DOCROOT'config/telnet.sh'echo $CPUAThe error will be like follows:: not found No such file or directory: not found No such file or directory/home/sugunan/phobos/: not found No such file or directory: cannot open No such file or directoryos/I use following ways to run the script ksh poc.shsh poc.sh./poc.shAll of the above giving similar error. Even I include #!/bin/bash still the error exist.

Jan 17, 2017  /usr/bin/env 'bashr': No such file or directory #23. Closed rolylolypoly opened this issue Jan 17, 2017 5 comments. It seems like it's because the quickstart project was zipped on a windows machine. JacisNonsense closed this in 5b573e5 Jan 17. I'll set up some automated system in the future since it's such a recurring issue.

I have tried #!/bin/ksh and #!/usr/bin/ksh also. All of that gives the error. What may be the reason for the issue on this server? It appears like the empty lines contain an invisible (unprintable) character, and the server is trying to run it as if it were the name of a command; hence the error: not found No such file or directory. Delete the empty lines or ensure they're really empty.Edit: OP's comment confirms that it is indeed the case, as the code was written under Windows.

/usr/bin/env:FileFile

On Windows, ASCII text files end each line with a Line Feed + Carriage Return character, while UNIX uses only a Line Feed.To solve this, you can either:. copy & paste the code directly on an editor under Linux. make sure you set your Windows editor to convert end-of-line characters to the UNIX standard. use the dos2unix command to convert the Windows ASCII file to a UNIX one.

Windows /usr/bin/env: Bash : No Such File Or Directory List

I have a docker-compose.yml file where i defined the images and the build for php.

Comments are closed.