简体   繁体   English

tcsh提示行事很奇怪

[英]tcsh prompt acting weird

I've got this line my .cshrc.user (using tcsh) 我的.cshrc.user有这行(使用tcsh)

set prompt = "%{\033[36m%}%m%{\033[32m]%}{`echo $CLEARCASE_ROOT | cut -d / -f 3`}%{\033[0m%}> "

And it's working nicely with the colors and everything. 它可以很好地处理颜色和所有内容。 But when I try this: 但是当我尝试这个:

echo $prompt

It just gives me either 它只是给我

Missing ].

or 要么

Missing }.

depending on wether a clearcase view is set or not. 取决于是否设置了清除案例视图。

At a guess, I'd say that the variable CLEARCASE_ROOT has a [ or a { character. 猜一猜,变量CLEARCASE_ROOT具有[{字符。 Try quoting the variable when performing the echo? 尝试在执行回显时引用变量? ie: 即:

echo "$prompt"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM