Topic
  • 4 replies
  • Latest Post - ‏2012-07-16T14:30:07Z by oldchevy
oldchevy
oldchevy
23 Posts

Pinned topic ccm commands stopped working in perl script

‏2011-06-06T20:03:34Z |
Synergy version 7.1
Perl version 5.8.6

I have a perl script that worked well for years. Now, my ccm command fails because perl can't seem to understand double-quotes within the ccm command. Here's an example of the perl line ccm command:

$temp = `ccm baseline -u -ns -sh tasks $base -f "task_number"`;

This ends up with $temp being empty, although it used to work great;

If I remove the '-f' format string and just accept the default format string, it works. But, I need my own format string (not just task_number). I've tried escaping the double-quotes with '\' and setting my format string to a variable to no avail.

Anyone have success with perl and Synergy lately?
Updated on 2012-07-16T14:30:07Z at 2012-07-16T14:30:07Z by oldchevy
  • David.Honey
    David.Honey
    176 Posts

    Re: ccm commands stopped working in perl script

    ‏2011-06-07T09:46:41Z  
    Your format string only consists of the string literal "task_number". In other words, for each task included in the baseline, the output will be the literal string "task_number". If you meant to display a property or pseudo-property, such as the associated tasks, you need to use %task or %{task}. However, such a keyword makes no sense for the command being executed. %task is a pseudo-property that shows the associated tasks of a file or directory. The ccm baseline -show tasks command is already showing tasks. So if you wanted only the task identifiers to be shown, use %displayname.

    What happens when you execute the same command within a standard Unix shell such as ksh or bash? For example:
    
    # result=`ccm baseline -show tasks -u -ns -f %displayname <baseline_spec>`
    


    Check that the baseline specification being provided resolves to a baseline. If the baseline specification does not resolve to a baseline, then there will be no tasks written on stdout, and an error should be written to stderr.

    David.
  • oldchevy
    oldchevy
    23 Posts

    Re: ccm commands stopped working in perl script

    ‏2011-06-07T17:09:09Z  
    Your format string only consists of the string literal "task_number". In other words, for each task included in the baseline, the output will be the literal string "task_number". If you meant to display a property or pseudo-property, such as the associated tasks, you need to use %task or %{task}. However, such a keyword makes no sense for the command being executed. %task is a pseudo-property that shows the associated tasks of a file or directory. The ccm baseline -show tasks command is already showing tasks. So if you wanted only the task identifiers to be shown, use %displayname.

    What happens when you execute the same command within a standard Unix shell such as ksh or bash? For example:
    <pre class="jive-pre"> # result=`ccm baseline -show tasks -u -ns -f %displayname <baseline_spec>` </pre>

    Check that the baseline specification being provided resolves to a baseline. If the baseline specification does not resolve to a baseline, then there will be no tasks written on stdout, and an error should be written to stderr.

    David.
    David,

    That's just typos on my part since my script is on a closed system. The exact line of perl that used to work great is:

    print CCMTEMP `ccm baseline -u -ns -sh tasks $base -f "%task_number-%status %owner %task_synopsis"`;

    This results in no error but nothing gets written to CCMTEMP. If I remove the -f completely it works great but I need my format string for further processing in the perl script. $base gets resolved to "ALIGN_2.5.2" which is a valid baseline. If I run the ccm baseline command above on the Synergy cmd line it works as designed.

    This is PC only. If I'm on Unix I'd use my ksh version of the script which I prefer and have never had any problems with. Anyway, your example returns the one task that's in the ALIGN_2.5.2 baseline.

    Thanks for your time!
    Terry
  • David.Honey
    David.Honey
    176 Posts

    Re: ccm commands stopped working in perl script

    ‏2011-06-08T08:22:23Z  
    • oldchevy
    • ‏2011-06-07T17:09:09Z
    David,

    That's just typos on my part since my script is on a closed system. The exact line of perl that used to work great is:

    print CCMTEMP `ccm baseline -u -ns -sh tasks $base -f "%task_number-%status %owner %task_synopsis"`;

    This results in no error but nothing gets written to CCMTEMP. If I remove the -f completely it works great but I need my format string for further processing in the perl script. $base gets resolved to "ALIGN_2.5.2" which is a valid baseline. If I run the ccm baseline command above on the Synergy cmd line it works as designed.

    This is PC only. If I'm on Unix I'd use my ksh version of the script which I prefer and have never had any problems with. Anyway, your example returns the one task that's in the ALIGN_2.5.2 baseline.

    Thanks for your time!
    Terry
    Hi Terry,

    Is this with the classic CLI, Synergy CLI or both?

    There is a known defect with the Synergy CLI in 7.0 and 7.1 that on Windows, output sometimes contains <CR><CR><LF> instead of the usual <CR><LF> end-of-line convention. That defect has been fixed in 7.2, and is planned to be fixed in the next fixpack for 7.1.

    BTW, the classic CLI erroneously used <LF> for EOL on Windows instead of the normal convention of <CR><LF>.

    I don't know if that's relevant to your usage case.

    Regards,
    David.
  • oldchevy
    oldchevy
    23 Posts

    Re: ccm commands stopped working in perl script

    ‏2012-07-16T14:30:07Z  
    OBE