Using Partial Quoting

Sometimes only part of an argument should be quoted. Suppose you want to list the contents of ~ann/Volume II, i.e., the Volume II directory under ann's account. You cannot leave the name unquoted because it contains a space, but you cannot quote the whole thing, either, because such quotes would prevent ~ann from being expanded properly:

% ls ~ann/Volume II
/usr/staff/ann/Volume not found
II not found
% ls "~ann /Volume II"
~ann /Volume II not found

Instead, quote the space with a backslash or use quote marks to quote part of the name. The following commands allow expansion of ~ann while preventing the space from acting as an argument separator:

% ls ~ann /Volume\ II            (or)
% ls ~ann /'Volume II'

Get Using csh & tcsh now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.