我可以使用 `setcs` 将配置规范设置为变量吗?

Can I use `setcs` to set a configspec to a variable?

背景

在clearcase中,命令setcs用于以下示例:

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

问题

我有一个脚本,我正在尝试执行以下操作:

  1. 获取我之前在脚本中生成的特定视图的 configSpec(使用 first line edited out)。
  2. 删除配置规范中显示“element * CHECKEDOUT”的行(我使用 this method
  3. 将该视图的 configSpec 设置为我所做的新编​​辑。

下面是我为尝试此操作而编写的代码:

configSpec=`cleartool catcs -tag $VIEW_NAME | tail -n +2`
noCheckout=`printf '%s\n' "{$configSpec//element * CHECKEDOUT/}"`
cleartool setcs -tag $VIEW_NAME $noCheckout

它returns给定的错误:

cleartool: Error: Extra arguments: "SET:"

恰好是 noCheckout 变量中的第一个词。

问题

如何使用字符串变量作为中介来编辑和更新配置规范?

我建议不要使用字符串变量作为中介,而是使用 文件,因为 cleartool setcs pname 是:

pname
Specifies a text file whose contents are to become the view's new config spec.

所以,如果可以的话,,并使用 per-determined 文件名作为 setcs 命令的参数。