Saturday, February 24, 2024
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 70725  / 2 Years ago, sat, october 23, 2021, 2:40:10

i have looked everywhere and im feeling hopeless



my file is this



 mkdir -p ~/Desktop/new_file && echo "helloworld > ~/Desktop/new_file.txt


I've also tried



 hello
world

hello ; world


I'm trying to accomplish a return signal to my hello world output for a multi line sentence all from the terminal


More From » ubuntu-touch

 Answers
4

The man page for echo shows the following:


DESCRIPTION
Echo the STRING(s) to standard output.

-n do not output the trailing newline

-e enable interpretation of backslash escapes

If -e is in effect, the following sequences are recognized:

backslash


new line

Which means that if you want multi-line output, you would simply start with echo -e and would add in a
for new line.


mkdir -p ~/Desktop/new_file && echo -e "hello
world" >> ~/Desktop/new_file/new_file.txt

Hope this helps!


[#11770] Saturday, October 23, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ithriv

Total Points: 46
Total Questions: 115
Total Answers: 96

Location: Malaysia
Member since Wed, May 11, 2022
2 Years ago
;