shell去掉输出的末尾换行符

echo -n $(you_command)即可。

比如:

echo -n $(echo test)

输出:

[searchstar@localhost ~]$ echo -n $(echo test)
test[searchstar@localhost ~]$
posted @ 2024-09-28 14:11  寻找繁星  阅读(252)  评论(0)    收藏  举报