[p4] Tool arguments

Steven W. Orr steveo at syslang.net
Thu Oct 12 11:00:55 PDT 2006


On Thursday, Oct 12th 2006 at 10:46 -0400, quoth Weintraub, David:

=>In Unix, the "#" is a comment character, and if not quoted, it will mark
=>the rest of the line as a comment. I don't know what happens on a
=>Windows box (unless you're using Cygwin which would have the same
=>problems as Unix).
=>
=>Could you put the file name in quotes along with the "#have,head"
=>suffix? That may take care of this issue. 

I tried that one myself first. Yes, the # is a comment delim but if you 
say 

echo foo#bar 
it says foo#bar

If you say 

echo #Foo,#bar

you get nothing, BUT! if you say

echo %D#Foo,#bar

you get

%D#Foo,#bar

So I guess the point is that bash is slightly smart about delims. YMMV.

As far as quoting goes, I'm a big believer in the philosophy of minimal 
quoting. If you have to quote then do it, but if there's no variable 
interpolation going on then use singlequotes. Flip: If you do interpolate 
then use double quotes. In this case, if %D was was come back empty then 
you're hosed. Try 

-c $c sync '%D#have,#head'

and just on general principals

-c "$c" sync '%D#have,#head'

=>
=>-----Original Message-----
=>From: perforce-user-bounces at perforce.com
=>[mailto:perforce-user-bounces at perforce.com] On Behalf Of Kris Kumler
=>Sent: Thursday, October 12, 2006 10:05 AM
=>To: perforce-user at perforce.com
=>Subject: [p4] Tool arguments
=>
=>Hi,
=>
=>I was trying to set up a tool from p4win that would run p4 to sync on
=>the current files on the client, as was recently discussed on this list.
=>The arguments I tried were:
=>-c $c sync %D#have,#head
=>
=>However, when it was executed, the "#have,#head" portion was not
=>included.
=>Is there an escape code or other syntax required to get this to work as
=>intended?

-- 
A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


More information about the perforce-user mailing list