Re: [p4] ztag and grep, discovering and printing string

Sambwise <[email protected]> Sun, 15 Apr 2018 18:20:01 -0700
Newsgroups gmane.comp.version-control.perforce
Message-ID <[email protected]>
Posted on behalf of forum user 'Sambwise'.

Run the command without the -F to see all the fields:

C:\Perforce\test>p4 -e grep -an -e asdf foo info:
//stream/main/foo#2:1:asdfasdf code0 369105429 (sub 533 sys 6 gen 0 args 6 sev 1
uniq 6677) ... code0 369105429 ... fmt0
%depotFile%#%depotRev%%separator1%%linenumber%%separator2%%linecontent% ...
depotFile //stream/main/foo ... depotRev 2 ... separator1 : ... linenumber 1 ...
separator2 : ... linecontent asdfasdf  
The piece you want is called "linecontent", so do:

p4 -F "%depotFile%;%depotRev%;%linenumber%;%linecontent%" grep -a -n
-s -e "Nothing" "//streams/dev/server/ReadMe.txt"



--
Please click here to see the post in its original format:
  http://forums.perforce.com/index.php?/topic/5689-ztag-and-grep-discovering-and-printing-string
_______________________________________________
perforce-user mailing list  -  [email protected]
http://maillist.perforce.com/mailman/listinfo/perforce-user