echo 换行不换行
echo换行输出需要转义符 -e
看以下例子:
1 echo -e "It is the first line." >> a; echo -e "It is the second line.\c" >> a; echo -e "It is the third line." >> a; echo -e "\nIt is the forth line." >> a
输出:
It is the first line. //默认换行 It is the second line.It is the third line. //第二行指定不换行,因此第三行紧跟第二行 It is the forth line. //第三行默认换行,而且第四行前制定换行,因此中间空了一行
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步