I was going to ask this on superuser.com but there were only 5 perforce tags so I came here…
How can I get a list of workspaces on a specific machine with p4?
I can run p4 workspaces, but that gives me all of them, ever.
How can I filter it down to a specific machine(client) name.
Depends on your environment. I’ve included a basic Windows batch file for doing this.
Run
p4 clients. Pull the second word out of each line, that’s the client name. Runp4 client -o <name>. Grep for^Host:.*\b<hostname>\b. If grep returns success, that client is for that machine. Accumulate the list.In Windows: