欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

shell腳本如何實現(xiàn)echo輸出不換行功能-創(chuàng)新互聯(lián)

這篇文章主要為大家展示了“shell腳本如何實現(xiàn)echo輸出不換行功能”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“shell腳本如何實現(xiàn)echo輸出不換行功能”這篇文章吧。

創(chuàng)新互聯(lián)科技有限公司專業(yè)互聯(lián)網(wǎng)基礎服務商,為您提供聯(lián)通機房服務器托管高防服務器,成都IDC機房托管,成都主機托管等互聯(lián)網(wǎng)服務。

There are as many ways to solve this quirky echo problem as there are pages in this book. One of my favorites is very succinct:

function echon
{
 echo "$*" | awk '{ printf "%s" $0 }'
}

You may prefer to avoid the overhead incurred when calling the awk command, however, and if you have a user-level command called printf you can use it instead:

echon()
{
 printf "%s" "$*"
}

But what if you don't have printf and you don't want to call awk? Then use the tr command:

echon()
{
 echo "$*" | tr -d '\n'
}

This method of simply chopping out the carriage return with tr is a simple and efficient solution that should be quite portable.


以上是“shell腳本如何實現(xiàn)echo輸出不換行功能”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學習更多知識,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

分享名稱:shell腳本如何實現(xiàn)echo輸出不換行功能-創(chuàng)新互聯(lián)
網(wǎng)站地址:http://www.chinadenli.net/article12/ggddc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供標簽優(yōu)化網(wǎng)站建設網(wǎng)站設計公司動態(tài)網(wǎng)站微信公眾號自適應網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作