Newline in bash

echo $'\n'

Or

echo -e '\n'

It seems simple, but of several options only one worked echo $'\n'

#!/bin/bash echo "n" echo $'\n' echo \n echo '\n'

n n \n

↓ Bash articles ↓
Bash
Bash Scripting
-eq -gt …: Comparison operators
if else: Conditional operators
while loop
date
Arithmetic operations
Pass a file or password over SFTP in a Bash script
Errors Bash

Article author: Andrei Olegovich

Banner image