assign macro to result of internal kermit command - Protocols

This is a discussion on assign macro to result of internal kermit command - Protocols ; I'm sure I'm missing something obvious, but I can't get the syntax right to store the output of an internal command directly into a macro. I was thinking I could easily store the result of ftp modtime \m(file) into a ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: assign macro to result of internal kermit command

  1. assign macro to result of internal kermit command

    I'm sure I'm missing something obvious, but I can't get the syntax right to
    store the output of an internal command directly into a macro.

    I was thinking I could easily store the result of ftp modtime \m(file) into
    a macro, for use with later date comparision, but I can't seem to find the
    correct function to use.

    I could, of course, write the result to a file, and then read it, was just
    hoping to avoid the kludge.

    Am I missing some syntactic sugar, or overlooking a function?


    TIA






  2. Re: assign macro to result of internal kermit command

    On 2007-11-05, NoSpam wrote:
    : I'm sure I'm missing something obvious, but I can't get the syntax right to
    : store the output of an internal command directly into a macro.
    : ...
    : I could, of course, write the result to a file, and then read it, was just
    : hoping to avoid the kludge.
    :
    : Am I missing some syntactic sugar, or overlooking a function?
    :
    You're not missing anything. Most C-Kermit commands simply write their result
    to stdout. In some cases the output can be quite long (e.g. a listing of a
    huge directory tree) so it's not practical to store the result of every
    command in memory. But in many cases, when the result is something you might
    want to use programmatically, the result is made available in some way.

    : I was thinking I could easily store the result of ftp modtime \m(file) into
    : a macro, for use with later date comparision, but I can't seem to find the
    : correct function to use.
    :
    Hint: After doing some command where you want to use the result, tell Kermit
    to "show variables" and see if you see the result. In this case:

    C-Kermit>ftp modtime linux-headers.tar.gz
    linux-headers.tar.gz 2007-08-16 18:56:53 GMT
    C-Kermit>show var ftp
    \v(ftp_code) = 213
    \v(ftp_cpl) = clear
    \v(ftp_connected) = 1
    \v(ftp_dpl) = clear
    \v(ftp_getputremote) = auto
    \v(ftp_host) = panix.com
    \v(ftp_loggedin) = 1
    \v(ftp_message) = 20070816185653
    \v(ftp_security) = NULL
    \v(ftp_server) = UNIX
    C-Kermit>

    In this case I said "show var ftp" to show all the variables whose names
    contain "ftp". As you can see \v(ftp_message) has th desired datum.

    - Frank

  3. Re: assign macro to result of internal kermit command

    Ahh.

    TYVM, as usual.




+ Reply to Thread