Question

I've got the following Perforce command in a bat file:

p4 -c myworkspace sync //path/... 

and I want to re-direct the output to a file. I tried:

p4 -c myworkspace sync //path/... >> file.txt

but the output is show in the command line and doesn't appear in the file. How to solve this?

Is there a parameter I can send to perforce to write the output to a file or can I do this directly from the bat?

Was it helpful?

Solution

It may be writing to the STDERR stream so this could help.

p4 -c myworkspace sync //path/... >>file.txt 2>&1

>>file.txt will append to file.txt and >file.txt will create a new file every time.

OTHER TIPS

foxidrive's answer pertains only to bash.

For (t)csh, STDERR stream redirection is different, use

p4 -c myworkspace sync //path/... >> & file.txt

Refer here for more redirection options.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top