You could use printf
instead:
printf "hello\nworld\n"
printf
has more consistent behavior than echo
. The behavior of echo
varies greatly between different versions.
Related Posts:
- Echo newline in Bash prints literal \n
- Echo newline in Bash prints literal \n
- Multi-line string with extra space (preserved indentation)
- Multi-line string with extra space (preserved indentation)
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- -bash: syntax error near unexpected token `newline’
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- How do I split a string on a delimiter in Bash?
- How to change the output color of echo in Linux
- ./configure : /bin/sh^M : bad interpreter
- How can I add numbers in a Bash script?
- How can I find the path to an executable in OSX
- Using prevNext Modx Addon
- :wq! command in vim
- how to set the background color of the status bar during the launching phase [duplicate]
- api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft Office file [closed]
- When is K 1024 and when is it 1000?
- What is a MIME type?
- Logitech/LGHUB Lua – Loop with break
- are there dictionaries in javascript like python?
- How can I convert MP3 file to a Base64 encoded string? [closed]
- Understanding The Modulus Operator %
- Understanding the main method of python [duplicate]
- Dial pad to get phone number (with Android button images)
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- How is the AND/OR operator represented as in Regular Expressions?
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Istio Ingress resulting in “no healthy upstream”
- Why is it not possible to fake an IP address?
- How to open a “-” dashed filename using terminal?
- How do I deal with a filename that starts with the hyphen (-) character?
- Substring in excel
- What is a LAMP stack?
- What is a sanity test/check
- What is the difference between POST and PUT in HTTP?
- What is the difference between POST and PUT in HTTP?
- How to find Google’s IP address?
- What exactly is a VBO in OpenGL?
- What and where are the stack and heap?
- ping response “Request timed out.” vs “Destination Host unreachable”
- Authentication versus Authorization
- What is a reverse shell?
- How does npm start work? What all processes are happening in the background?
- What is an instance variable in Java?
- What is the := operator?
- What is tail recursion?
- Discord music bot not working
- What does “:=” mean in Pseudocode? [closed]
- Why am I getting error for apple-touch-icon-precomposed.png
- No results found on kibana -> discover
- What is Xpenology? Is it Linux related thing?
- Bash: No such file or directory?
- Why do we need virtual functions in C++?
- How do I pause my shell script for a second before continuing?
- Cp: target is not a directory
- Why is “MINGW64” appearing on my Git bash?
- What is a CSRF token? What is its importance and how does it work?
- Create blank image in Imagemagick
- Official definition of CSCI (Computer Software Configuration Item)
- How could I ping @here in Discord.py?
- Python Math – TypeError: ‘NoneType’ object is not subscriptable
- How do I split a string on a delimiter in Bash?
- What does %>% mean in R [duplicate]
- super() in Java
- Visual List of iOS Fonts?
- What is useState() in React?
- TCP vs UDP – What is a TCP connection? [duplicate]
- How do I copy folder with files to another folder in Unix/Linux? [closed]
- How to split a string into an array in Bash?
- ssh : Permission denied (publickey,gssapi-with-mic)
- Eclipse IDE for Java – Full Dark Theme
- How do I tell if a regular file does not exist in Bash?
- Amazon Linux: apt-get: command not found
- Google Calendar API event insert always return 404 “not found” error
- ssh connect Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
- What’s the syntax for mod in java
- What does the Java assert keyword do, and when should it be used?
- How to get rid of the “No bootable medium found!” error in Virtual Box? [closed]
- How to create a file in Linux from terminal window? [closed]
- How do I fix a “Expected Primary-expression before ‘)’ token” error?
- Using getline() with file input in C++
- What is newline character — ‘\n’
- STDERR? What is it? What are its common uses?
- UML Sequence diagram auto-numbering in Visual Paradigm
- Error in “MLSD” command While Connecting FTP to Server [closed]
- Java default constructor
- How do I make a delay in Java?
- Java String new line
- In the shell, what does ” 2>&1 ” mean?
- Casting variables in Java
- Handling file renames in Git
- PermissionError: [Errno 13] in Python
- Why are there two ways to unstage a file in Git?
- Is double square brackets [[ ]] preferable over single square brackets [ ] in Bash?
- ‘git’ is not recognized as an internal or external command
- Extract substring in Bash
- did you specify the right host or port? error on Kubernetes
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- How does Java’s PriorityQueue differ from a min-heap?
- What is the preferred Bash shebang?