It's all about the answers!

Ask a question

How to pipeout the SCM CLI results (eg.listing locks in a stream)?

vijayakumar ramesh (1173862) | asked Feb 14 '17, 5:44 a.m.

I am trying to list all the file locks in a stream, from SCM CLI. I am unable to pipeout the results.Suggestions please.
Find the below image

One answer

permanent link
Shashikant Padur (4.2k27) | answered Feb 14 '17, 6:33 a.m.

Looks like you are not using the regular command shell... probably powershell?

This may work: cmd /c lscm ls locks  -r local -s 1109 -m 10 '> file.txt 2'>'&1

vijayakumar ramesh commented Feb 15 '17, 5:31 a.m. | edited Feb 15 '17, 5:44 a.m.

I tried your command and other forms of it but it didnt work.. point me where I am  going wrong.
Are you sure that out put of SCM CLI can be written to file ?


vijayakumar ramesh commented Feb 15 '17, 5:32 a.m.

I am using the regular command shell.

Shashikant Padur commented Feb 15 '17, 10:30 p.m.

 The command I listed out was to be used with the powershell. Piping is nothing to do with scm cli and yes it works.

Donald Nong commented Feb 16 '17, 3:22 a.m.

Vija, if using a regular command shell, simply remove all the single quote sign in the command, so the end of the command looks like: > file.txt 2>&1

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.