Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这里有一段代码。
$ a=aa $ b=bb $ echo -e $a"\t"$b aa bb $ c=`echo -e $a"\t"$b` $ echo $c aa bb $ echo -e $c aa bb
我想将 $a 和 $b 与选项卡连接起来,并将结果设置为变量 c 以供进一步使用。
但是当我回显 $c 时,没有选项卡显示,只有一个空格。
我应该怎么办?
尝试这个:
echo "$c"
您需要引用变量。此外,由于您在分配到 期间已经解释了转义序列,因此在回显该值时c无需指定。-e
c
-e