Background
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
Problem
I have a script where I am attempting to do the following:
- Grab the configSpec of a certain view that I generated earlier in the script (with the first line edited out).
- Remove the line in the configspec that says "element * CHECKEDOUT" (I used this method)
- Set that view's configSpec to the new edits I made.
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.
Question
How can I edit and update the configspec using a string variable as an intermediary?