I am trying to add an Windows AltRoot to my p4 client automatically in command line without needing to edit the client form interactively. I am doing this from a Linux machine. Below is the command I tried:
p4 client -o | sed "s@AltRoot:@AltRoot:\n\tN:\\\path\\\to\\\the\\\client@" | p4 client -i
However, p4 client is recognizing the drive number N: as an invalid p4 client field name.
How do we get around this?
Use the
--fieldglobal option to edit the fields produced by a<spec> -ocommand. This option uses the built-in spec parser so you don't need to fiddle with regexes.You can then pipe the result directly to
p4 client -i: