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 'testc'
test[root@BC-CentOS7-2 ~]# 

原文地址:https://www.cnblogs.com/wlinuxtop/p/14877148.html