shell中echo信息时增加换行(Add line feed when echo information in shell)

shell中echo信息时增加换行

背景:在写了个shell时,如果用户输入参数错误想给用户提示,发现echo的信息默认在一行显示不太直观,想换行显示

# shell中echo信息 换行显示:加 -e 参数即可
echo -e "\n======================== 开始执行case ========================\n\n"

# do something

echo -e "\n\n======================== 执行case结束 ========================\n"

————————

shell中echo信息时增加换行

Background: when writing a shell, if the user inputs wrong parameters and wants to give a prompt to the user, it is found that the echo information is displayed on one line by default, which is not very intuitive. I want to display it on a new line

# shell中echo信息 换行显示:加 -e 参数即可
echo -e "\n======================== 开始执行case ========================\n\n"

# do something

echo -e "\n\n======================== 执行case结束 ========================\n"