如何在提示之前删除新行。我不完全知道如何提出这个问题,所以这里有一个例子。
我想从
%> echo "hello world"
hello world
%>
至
%> echo "hello world"
hello world%>
我尝试用 sed's/\\n//'替换新行。即使有\\r和tr。也许切割功能会准确?
echo -n我得到的方法
%> echo -n "hello world"
hello world% #note the new character % just appeared
%>