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.                                  //第三行默認換行,而且第四行前制定換行,因此中間空了一行

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM