CLI script
  • Order of the Butterfly
    Order of the Butterfly
    winterhunter
    Posts: 204 from 2005/10/13
    From: PACA, France
    Hi everyone,

    I was trying to set up some scripts, and I've realized that I don't
    have the slightest idea how the arguments that are passed onto a
    script are named.

    If I create a script named "test", which prints the arguments that are
    passed onto it, how should I do? How is this variable called?
  • »23.02.06 - 19:35
    Profile Visit Website
  • pOS
  • Order of the Butterfly
    Order of the Butterfly
    pOS
    Posts: 216 from 2003/11/14
    From: Bavaria
    Hi,

    a batch script with arguments looks like this:

    Code:

    .bra {
    .ket }
    .key NAME/A,LOCATION,AGE/N,MALE

    echo My Name is {NAME}, I live in {LOCATION}.

    if {MALE} eq YES
    echo I'm a man
    else
    echo I'm a woman
    endif

    echo I'm {AGE} years old


    So .key defines an argument template as known from other CLI programms.
    .bra and .ket define how the arguments have to be enclosed with, when used. You don't need to use {} but can whatever you like.
  • »23.02.06 - 20:31
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    winterhunter
    Posts: 204 from 2005/10/13
    From: PACA, France
    Thanks a lot for the mini-tutorial!
  • »24.02.06 - 13:43
    Profile Visit Website