In clearcase, the command setcs
is used in the following examples:
Change the config spec of the current view to the contents of file cspec_REL3.
cmd-context setcs cspec_REL3
Change the config spec of the view whose view tag is jackson_vu to the default config spec.
cmd-context setcs –tag jackson_vu –default
Have the view_server of the current view reread its config spec.
cmd-context setcs –current
I have a script where I am attempting to do the following:
Below is the code I wrote to attempt this:
configSpec=`cleartool catcs -tag $VIEW_NAME | tail -n +2`
noCheckout=`printf '%s\n' "{$configSpec//element * CHECKEDOUT/}"`
cleartool setcs -tag $VIEW_NAME $noCheckout
It returns the given error:
cleartool: Error: Extra arguments: "SET:"
which just so happens to be the first word in the noCheckout
variable.
How can I edit and update the configspec using a string variable as an intermediary?
I would recommend, instead of using a string variable as an intermediary, to use a file, since cleartool setcs pname
is:
pname
Specifies a text file whose contents are to become the view's new config spec.
So, if you can, redirect the content of your variable to a file (fprintf
), and use that per-determined filename as argument of your setcs
command.