当然,可以使用 echo -e 以便将 \n 理解为新行。问题是当我想回显以 \t 开头的内容时,例如“\test”。
假设我想表演echo -e "test\n\\test"。我期望输出:
echo -e "test\n\\test"
test \test Run Code Online (Sandbox Code Playgroud)
test \test
但相反输出:
test est Run Code Online (Sandbox Code Playgroud)
test est
被\\t解释为制表符而不是文字 \t。这个问题有一个干净的解决方法吗?
\\t
bash echo quoting
bash ×1
echo ×1
quoting ×1