in reply to ClearCase Command text in Backticks is ignored
If you are having trouble with escaping on a command line call that you do not need to capture output from, the easiest solution is usually multi-argument system. That way, Perl will handle escaping and quoting for you as necessary. Your call might look like:
my $output = system('cleartool', 'lsco', '-r', '-brt', $stream, '-fmt' +, '%En\t%u\n');
It's also possible that the last term there should be something more like "%En\t%u\n", which gets to why I suspect your backtick call is failing; I would guess that the format string passed can't contain literal control characters. Perhaps you'll get your desired result from:
or possiblymy $output = `cleartool lsco -r -brt $stream -fmt "%En\\t%u\\n"`;
my $output = `cleartool lsco -r -brt $stream -fmt '%En\\t%u\\n'`;
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ClearCase Command text in Backticks is ignored
by Deep_Plaid (Acolyte) on May 08, 2013 at 16:16 UTC | |
by kennethk (Abbot) on May 08, 2013 at 16:41 UTC |