Answers for "bash newline in string"

5

echo new line

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

echo new line

echo -e "hello\nworld"
# Output
  /*
   * hello
   * world
   */
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
0

shell keep newline at output

# You want to say
echo "$lines"

# instead of
echo $lines

# $, $() and `` remove \n \t ...
# By "string-ing" it, it keeps them.
Posted by: Guest on January-14-2022

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language