Given this variable in tcsh:
set i = ~/foo/bar.c
how can I get just the directory part of $i
?
~/foo
If your system provides a 'dirname' command you could:
set i = `dirname ~/foo/bar.c`
echo $i
Note the missing $ in front of the variable name. This solution is shell agnostic though.