I meet a problem that when I run clearcase command:
ct find . -branch \'brtype(my_branch)\' -exec \"echo %CLEARCASE_XPN%\"`
%CLEARCAS
Use:
ct find . -branch 'brtype(my_branch)' -exec 'echo $CLEARCASE_XPN'
%CLEARCASE_XPN%
is a windows syntax.
$CLEARCASE_XPN
is the unix syntax, that you can use in your Linux tcsh session.
See "cleartool find" and "Additional examples of the cleartool find command" for many examples using the unix syntax.
Note also the use of simple quotes around the exec directive: -exec 'echo $CLEARCASE_XPN'
.
That will prevent the shell itself to interpret immediately the $CLEARCASE_XPN
variable (which is unknow for the tcsh session) and will allow the cleartool find to pass the right value to the exec directive, replacing $CLEARCASE_XPN
with the extended pathname.
See "String quoting (single quote) vs. Weak Quoting (double quote)":
Strong quoting prevents characters from having special meanings, so if you put a character inside single quotes, what you see is what you get.
Therefore, if you are not sure if a character is a special character or not, use strong quotation marks.Weak quotation marks treat most characters as plain characters, but allow certain characters (or rather meta-characters) to have a special meaning. As the earlier example illustrates, the backslash within double quotation marks is a special meta-character.
It indicates the next character is not, so it can be used before a backslash and before a double quotation mark, escaping the special meaning.
There are two other meta-characters that are allowed inside double quotation marks: the dollar sign, and the back quote.