This is the (principal) function of double quotes, and it's true in csh and *sh shells.
cd "$TARGET"
should do it.
Shell variables are expanded within "..." (unlike within '...'), but the quoted text is regarded as a single argument when the shell parses the command line to construct the strings which are passed to the program.
For example:
% ls -F October @012/ % TARGET="October @012" % cd $TARGET bash: cd: October: No such file or directory % cd "$TARGET" % pwd /tmp/t/October @012 %
Simple!
What you're doing wrong in your initial example is escaping the space inside the quotes. The space doesn't have to be escaped twice, and because this redundant \ is appearing inside the quotes, it just inserts a backslash into the TARGET variable. For example:
% TARGET="October\ @012" # wrong! % ls October @012/ % cd $TARGET bash: cd: October\: No such file or directory % cd "$TARGET" bash: cd: October\ @012: No such file or directory %
This setting of TARGET would only work if the directory were named October\ @012, with a backslash in it (not recommended!):
% mkdir October\\\ @012 % ls -F October\ @012/ % cd "$TARGET" % pwd /tmp/t/October\ @012 %
(EDITED to add example)