Perforce uses the characters
# in file specifications. These characters also have special meaning in many command shells, which might require you to use quotes in your p4 commands. (On Unix, use single quotes; in the Windows MS-DOS shell, use double quotes.)
Example using # symbol
p4 sync #none
should remove all depot files from your workspace. If you find that what happens instead is that it syncs your entire workspace to head revisions, it is because your command shell interprets
# as a comment character. If this misinterpretation happens, try:
p4 sync '#none'
Example using asterisk
Or, for instance, if a command like
p4 files stuff/*
complains "no files found," it might be because your command shell is trying to expand the
* wildcard before Perforce even sees it. There are a number of ways you can use quotes. For example:
|MS-DOS||p4 files "stuff/*"|
p4 files stuff/"*"
|Unix||p4 files 'stuff/*'|
p4 files stuff/'*'
p4 files stuff/*
(Note that this would not work in MS-DOS batch scripts, where
%1 is special.)
Notes about the double forward slash
Perforce also makes frequent use of the double forward slash character combination "
" when referencing file paths. The
character combination might be interpreted by your shell as referencing a Universal Name Convention (UNC) path instead of a Perforce depot or client workspace path. If you experience abnormally long delays in getting results from Perforce commands using the //depot or
syntax, try quoting the entire path string. In general, only Unix shells on Windows are susceptible to this particular problem. For delays related to other network issues, see Isolating Network Problems