Answers for "how to print new line in shell script"

4

echo with new lines bash

# Using echo
echo -e "Line 1\nLine 2"
echo "Line 1 $HOME expanded
Line 2"
echo 'Line 1 $HOME not expanded
Line 2'

# Similar result, using cat
cat <<EOF
Line 1 $HOME expanded
Line 2
EOF
cat <<'EOF'
Line 1 $HOME not expanded
Line 2
EOF
Posted by: Guest on September-09-2020
2

echo new line

echo -e "hello\nworld"
Posted by: Guest on August-27-2020
1

echo new line in a file bash

echo -e "Line 1\nLine 2"
Posted by: Guest on March-24-2021
1

newline in echo unix

echo $'hello\nworld'
Posted by: Guest on August-29-2020
0

how to print new line in shell script

echo -e 'This is First Line \nThis is Second Line'
Posted by: Guest on January-26-2021

Code answers related to "how to print new line in shell script"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language