Run following command in terminal
sed -i -e 's/\r$//' scriptname.sh
Then try
./scriptname.sh
It should work.
More Related Contents:
- Erroe in script
- How to pass a variable containing slashes to sed
- Fast way of finding lines in one file that are not in another?
- sudo echo “something” >> /etc/privilegedFile doesn’t work [duplicate]
- How to detect the OS from a Bash script?
- While-loop subshell dilemma in Bash
- Variables in bash seq replacement ({1..10}) [duplicate]
- ffmpeg in a bash pipe
- Check existence of input argument in a Bash shell script
- How to simulate the environment cron executes a script with?
- How can I remove all text after a character in bash?
- How can I escape white space in a bash loop list?
- Intersection of two lists in Bash
- Compound ‘if’ statements with multiple expressions in Bash
- Remove first N lines of a file in place in unix command line
- How to address error “bash: !d’: event not found” in Bash command substitution [duplicate]
- Trying to embed newline in a variable in Bash [duplicate]
- Is there a bash command which counts files?
- How to write a bash script that takes optional input arguments?
- Checking Bash exit status of several commands efficiently
- Bash script to check running process [duplicate]
- Parsing a CSV file using gawk
- How to remove filename prefix with a Posix shell
- Why do I get “/bin/sh: Argument list too long” when passing quoted arguments?
- Validate date format in a shell script
- Using sed to insert file content
- How can you diff two pipelines in Bash?
- Retry a Bash command with timeout
- Read n lines at a time using Bash
- Missing Carriage Return in Docker for Mac Containers