It seems that you have Windows style line endings (\r\n
) – you need to change them to unix style (\n
). If you have dos2unix
installed you could use it. You could also do it using sed
or awk
.
More Related Contents:
- Get lines between two patterns
- How do I copy a folder from remote to local using scp?
- How to mkdir only if a directory does not already exist?
- How to select lines between two marker patterns which may occur multiple times with awk/sed
- “ls: not found” after running “read PATH”
- How to use multiple arguments for awk with a shebang (i.e. #!)?
- How to pass command line arguments to a shell alias? [duplicate]
- How do I kill background processes / jobs when my shell script exits?
- How could the UNIX sort command sort a very large file?
- sed whole word search and replace
- Meaning of $? (dollar question mark) in shell scripts
- What is /dev/null 2>&1?
- Using find to locate files that match one of multiple patterns
- Compare two files line by line and generate the difference in another file
- Floating-point arithmetic in UNIX shell script
- Using wget to recursively fetch a directory with arbitrary files in it
- How to download GitHub Release from private repo using command line
- How to input a path with a white space?
- Do a tail -F until matching a pattern
- Compare a string using sh shell
- Make xargs handle filenames that contain spaces
- Trim leading and trailing spaces from a string in awk
- How to assign the output of a command to a Makefile variable
- Block Comments in a Shell Script
- Can I call a function of a shell script from another shell script?
- Emacs shell scripts – how to put initial options into the script?
- How to run a shell script on every request?
- How to run commands via NodeJS child process?
- How to run SWI-Prolog from the command line?
- Exclude specific filename from shell globbing