[root@cnsz142728 September]# echo -n "1234" 1234[root@cnsz142728 September]# echo "5678" 5678
相似於vim
[root@cnsz142728 September]# cat kaka.sh #!/bin/bash echo "Please input number:" read ddd if [ $ddd -lt 30 ]; then echo "A" elif [ $ddd -gt 30 -a $ddd -lt 60 ]; then echo "That sound good idea!" else echo "C" fi [root@cnsz142728 September]# ./kaka.sh Please input number: 4 A [root@cnsz142728 September]# cat kaka.sh ^C [root@cnsz142728 September]# vim kaka.sh #!/bin/bash echo -n "Please input number:" read ddd if [ $ddd -lt 30 ]; then echo "A" elif [ $ddd -gt 30 -a $ddd -lt 60 ]; then echo "That sound good idea!" else echo "C" fi "kaka.sh" 12L, 181C written [root@cnsz142728 September]# ./kaka.sh Please input number:23 A #####################注意觀察結果中的Please input number:後面的空格
\a 發出警告聲;bash
\b 刪除前一個字符;ide
\c 最後不加上換行符號;idea
\f 換行但光標仍舊停留在原來的位置;spa
\n 換行且光標移至行首;code
\r 光標移至行首,但不換行;input
\t 插入tab;it
\v 與\f相同;im
\\ 插入\字符;ember
\nnn 插入nnn(八進制)所表明的ASCII字符;
[root@cnsz142728 September]# echo "\n567" \n567 [root@cnsz142728 September]# echo -e "\n567" 567