How to output a multiline string in Bash?

后端 未结 9 1741
忘了有多久
忘了有多久 2021-01-29 18:14

How can I output a multipline string in Bash without using multiple echo calls like so:

echo \"usage: up [--level | -n ][--help][--version         


        
9条回答
  •  渐次进展
    2021-01-29 18:54

    Use the -e argument and the escape character \n:

    echo -e "This will generate a next line \nThis new line is the result"
    

提交回复
热议问题