kermit script and unix arguments - Protocols

This is a discussion on kermit script and unix arguments - Protocols ; Hello, I want to use a kermit script starting with #!/usr/bin/kermit + with a line of argument (which can be empty). How the check if there are actually arguments ? In the case where there are arguement, how to put ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: kermit script and unix arguments

  1. kermit script and unix arguments

    Hello,

    I want to use a kermit script starting with #!/usr/bin/kermit +
    with a line of argument (which can be empty). How the check if there
    are actually arguments ? In the case where there are arguement, how to
    put then in local kermit variables? In fact, how to mimic with kermit
    the linux
    while getops "options here" option ; do ... ?

    Thanks a lot for help, Laurent


  2. Re: kermit script and unix arguments

    mortier writes:

    >Hello,
    >
    >I want to use a kermit script starting with #!/usr/bin/kermit +
    >with a line of argument (which can be empty). How the check if there
    >are actually arguments ? In the case where there are arguement, how to
    >put then in local kermit variables? In fact, how to mimic with kermit
    >the linux
    >while getops "options here" option ; do ... ?
    >
    >Thanks a lot for help, Laurent


    According to "Using C-Kermit" (2nd edition), \v(args) holds the number of
    arguments and the array \&@[] holds the arguments themselves.

    See http://www.columbia.edu/kermit/scriptlib.html for example scripts,
    many of which have code to parse command-line arguments.
    --
    Snappy Quote: "abcdefghijklmnopqrstuvwxyz"*
    *some assembly required

  3. Re: kermit script and unix arguments

    On 2007-07-09, Matthew Clarke wrote:
    : mortier writes:
    :
    :>Hello,
    :>
    :>I want to use a kermit script starting with #!/usr/bin/kermit +
    :>with a line of argument (which can be empty). How the check if there
    :>are actually arguments ? In the case where there are arguement, how to
    :>put then in local kermit variables? In fact, how to mimic with kermit
    :>the linux
    :>while getops "options here" option ; do ... ?
    :>
    :>Thanks a lot for help, Laurent
    :
    : According to "Using C-Kermit" (2nd edition), \v(args) holds the number of
    : arguments and the array \&@[] holds the arguments themselves.
    :
    : See http://www.columbia.edu/kermit/scriptlib.html for example scripts,
    : many of which have code to parse command-line arguments.
    :
    Actually the appropriate array is \&_[] and the appropriate count is \v(argc).
    The \&@[] array contains *all* the command-line arguments -- command-line
    options for Kermit as well as arguments for the script. When you write a
    kerbang script, normally you would only want the script to process the
    arguments that are for the script itself. And as expected the \&_[0] element
    contains the name of the script, rather than the name of Kermit. For details
    see:

    http://www.columbia.edu/kermit/ckermit70.html#x7.19 (kerbang scripts)

    and:

    http://www.columbia.edu/kermit/ckermit70.html#x7.19 (passing arguments)

    and:

    http://www.columbia.edu/kermit/ckermit70.html#x7.5 (using > 10 arguments)

    Note that \&_[1] through \&_[9] are the same as \%1 through \%9 -- i.e. the
    regular macro / command-file arguments. The array is useful for accessing
    the arguments programmatically by number, and also allows for more than 9
    arguments.

    - Frank

+ Reply to Thread