0

when I run this then everything work:

C:\PROGRA~1\cwRsync\bin\ssh.exe -o 'StrictHostKeyChecking no' 10.10.10.10 -l username /usr/atria/bin/cleartool setview -exec 'pwd' cm_myview

however if I have more than two arguments after exec like this:

C:\PROGRA~1\cwRsync\bin\ssh.exe -o 'StrictHostKeyChecking no' 10.10.10.10 -l username /usr/atria/bin/cleartool setview -exec 'cd /user' cm_myview

then it will fail with the error: extra argument:"cm_myview"

so right now if there is more than 2 argument after -exec, then it will say those argument are extra, anyone know how I can fix this. Thanks.

I am only running one command which run a script file. But I need to pass arguments to this script file. I think the program think the first argument is the view i am tying to set.

help
  • 809
  • 5
  • 18
  • 35
  • Put your commands in a script file on the remote host, and pass the file name to `-exec`? – tripleee Apr 15 '14 at 19:59
  • actually, that is what I am doing. I put all my commands in a script file, but I still need to pass arguments to the script file. If I pass more than one argument, then I will get an error. (I think the program think the first argument is the view i am tying to set, there should be nothing after that) – help Apr 15 '14 at 20:21
  • To put it simply: you don't need `setview`. You can use the full path of the view you wanted to set. – VonC Apr 15 '14 at 20:30

1 Answers1

0

Don't try to use setview: it spawns a sub-shell, which won't ever work well with multiple commands.
See "Python and ClearCase setview" for a concrete example of the kind of issue you will have.

Simply use the full path of a dynamic view, as I mention in "script doesn't run while executing in clearcase".

/view/aView/vobs/...

Make sure that this view is started first (cleartool startview)

No need for setview here.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I am only running one command (which is to run a script file which contain all my commands), but I need to pass arguments to this script file. If I have any argument, then I will get an error saying anything after the first argument is extra (I think the program think the first argument is the view i am tying to set, there should be nothing after that) – help Apr 15 '14 at 20:24
  • @help just don't. Trust me. Forget that `setview` ever existed. It is nothing but trouble. Call any script you want with any argument you want. Just not `setview`. – VonC Apr 15 '14 at 20:25