Variable expansion with a colon after it treats the letters after the colon as modifiers.
For example, $dir:h
means expand $dir
with the h
modifier. h
means head, i.e. all but the last part of the path.
% set dir=/home/user
% echo $dir:h
/home
All the info is in the tcsh(1) man page:
History substitution
...
The word or words in a history reference can be edited, or ‘‘modi-
fied’’, by following it with one or more modifiers, each preceded by a
‘:’:
h Remove a trailing pathname component, leaving the head.
t Remove all leading pathname components, leaving the tail.
r Remove a filename extension ‘.xxx’, leaving the root name.
e Remove all but the extension.
u Uppercase the first lowercase letter.
l Lowercase the first uppercase letter.
s/l/r/ Substitute l for r.
...
Variable substitution
...
The ‘:’ modifiers described under History substitution, except for
‘:p’, can be applied to the substitutions above.
You can avoid the modifier by wrapping the variable name in braces, e.g.
scp ${mycomp}:sourcepath destpath