1

I want to execute multiple commands in the cleartool.exe console, but ; or && doesnt work.

Example:

cd /myView; ct mkact myActivity

Any suggestions to run this?

I need to use cleartool.exe

2 Answers2

0

If you are running windows, you can include cleartool commands in a command like:

cd /d m:\tempview\testvob1 & cleartool desc .

Note the /d option. Otherwise the DRIVE won't change and you won't see the directory. You can also use pushd/popd to change the directory.

Multiple cleartool commands can be chained together the same way.

On unix, the semicolon works like the & sign.

If you want to put a bunch of cleartool commands together, you can do something like this:

  1. Create a text file with commands to run
  2. run cleartool < text file

    m:\tempview\mkvobtest-try2>copy con cleartool_stuff.txt find -all -type l -print desc . desc .@@ quit ^Z 1 file(s) copied.

    m:\tempview\mkvobtest-try2>cleartool < cleartool_stuff.txt M:\tempview\mkvobtest-try2\desktop M:\tempview\mkvobtest-try2\maketest2\make2.mk directory version ".@@\main\23" created 2014-04-11T12:10:40-04:00 by A User (auser.user@PC1) "Added directory element "Test"." Element Protection: User : NT:S-1-5-21-984945237-1216120022-2217536578-1001 : rwx Group: BUILTIN\Users : rwx Other: : rwx element type: directory predecessor version: \main\22 directory element ".@@" created 2010-03-10T12:25:01-05:00 by A User (auser.user@PC2) "Predefined directory element for root of versioned object base." element type: directory master replica: mrpeabody-rep@\mkvobtest-try2 Protection: User : NT:S-1-5-21-984945237-1216120022-2217536578-1001 : rwx Group: BUILTIN\Users : rwx Other: : rwx source pool: sdft cleartext pool: cdft derived pool: ddft

    m:\tempview\mkvobtest-try2>

The same technique works on unix, but the shells often give you additional options to do this.

Brian Cowan
  • 1,048
  • 6
  • 7
  • Hello Brian! I try your advice but it doesnt work...Here is the output that i get... Im Using the cleartool.exe from windows... cleartool> cd /d M:\dyn_PJ_COREDOC_link & startview dyn_PJ_COREDOC_int cleartool: Error: Extra arguments: "M:\dyn_PJ_COREDOC_link" Usage: cd [dir-pname] – benja tosello Nov 23 '16 at 14:04
  • You're in the interactive cleartool shell. So the /d option doesn't exist, and command chaining isn't supported. – Brian Cowan Nov 23 '16 at 18:56
0

In a simple CMD session, you can chain command with:

cmd /v /c "cd C:\path\to\myview&& cleartool mkact anActivity"

That is more convenient than trying to do it in a cleartool.exe session.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250