Search code examples
linuxtcsh

tcsh prompt acting weird


I've got this line my .cshrc.user (using 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.


Solution

  • At a guess, I'd say that the variable CLEARCASE_ROOT has a [ or a { character. Try quoting the variable when performing the echo? i.e.:

    echo "$prompt"