The issue is I have to touch a particular file in a ClearCase view after touching it, I have to exit the view.
And now I must reset the same view again.
Now when I reset, it will open in different mode.
I have tried this so far in shell script. When executing this script I am in view XYZ
#!/bin/sh
touch /ccase/.host;
exit;
ct setview XYZ
cd /ccase/src
The problem I am facing is in line 3 (exit;
).
I am coming out of script and not from view.
1- Use:
instead of
Then you will be able to access your view simply using:
and eventually do the same thing with another view and using the same or an other vob. This method will not open an other shell and you will get rid of any
exit
command in your scriptI would rather try without using
cleartool setview
.Access your data directly in the full path of your view:
/view/XYZ/vobs/yourVob
That way:
setview
in your script: that explain why your path is incorrect.See "Python and ClearCase setview" for an example of the kind of issue that sub-shell causes.
That obviously assume your dynamic view is already started (if not,
cleartool startview
).For a better understanding of why your shell cannot be completely executed when using
setview
, see "Setting into a view from a shell script does not process the remaining commands in the script"In your case, the cd /ccase/src is never called.
If you work directly with the full path of your started view, you don't create any sub-shell and don't have that issue: your last
cd /ccase/src
will be called.