Linux打印字符串不换行

基于特殊需求,需要字符串不换行。如计算base64的值

  方法1. echo -n 字符串

[root@BC-CentOS7-2 ~]# echo -n test
test[root@BC-CentOS7-2 ~]#

  方法2. echo -e ‘字符串\c’

[root@BC-CentOS7-2 ~]# echo -e 'test\c'
test[root@BC-CentOS7-2 ~]# 

 

posted @ 2021-06-12 00:33  魔阳工  阅读(508)  评论(0编辑  收藏  举报