在 perl 脚本(Unix env)中使用 mkattr?

Use mkattr in perl script (Unix env)?

Clearcase 命令行 mkattr 需要将变量 $bug_num 包裹在单引号 + 引号 + $varible + 引号 + 单引号之间,像这样:

cleartool mkattr -replace BUGNUM '"$bug_num"' clearcase_file

如何在 Unix 环境中的 Perl 脚本中调用命令 cleartool mkattr? 环境是 Unix AIX 和 ksh

所述:

If you want to execute a system command and don't have to use any shell syntax like redirects, it's usually better and safer to use the list form of system:

system(
    'cleartool',  'mkattr', '-replace', 'BUGNUM ',
    qq{"$bug_num"}, qq{clearcase_file}
);
# or, if you really want to pass both types of quotes:
system(
    'cleartool',  'mkattr', '-replace', 'BUGNUM ',
    qq{'"$bug_num"'}, qq{clearcase_file}
);

或者:

system(qq{cleartool mkattr -replace BUGNUM '"$bug_num"' clearcase_file});