qsh and expr utility - IBM AS400

This is a discussion on qsh and expr utility - IBM AS400 ; according with http://publib.boulder.ibm.com/iserie...rzahz/expr.htm I would like to use such a command expr 10 * 10 and woul like to get 100 as a result while I'm getting expr: 001-0060 Errore di sintassi durante la valutazione dell'espressione: operando non trovato. (sintax ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: qsh and expr utility

  1. qsh and expr utility

    according with
    http://publib.boulder.ibm.com/iserie...rzahz/expr.htm
    I would like to use such a command
    expr 10 * 10
    and woul like to get 100 as a result while I'm getting
    expr: 001-0060 Errore di sintassi durante la valutazione
    dell'espressione: operando non trovato.
    (sintax error: operand not found)
    To get the correct result I must escape some operators, e.g.
    expr 10 \* 10
    gives the correct result.
    Is it the correct way or am I missing somewhat?

    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherA˝e joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vŃo Ó merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  2. Re: qsh and expr utility

    "Dr.UgoGagliardelli" writes:

    > I would like to use such a command
    > expr 10 * 10
    > and woul like to get 100 as a result while I'm getting
    > expr: 001-0060 Errore di sintassi durante la valutazione
    > dell'espressione: operando non trovato.
    > (sintax error: operand not found)
    > To get the correct result I must escape some operators, e.g.
    > expr 10 \* 10
    > gives the correct result.
    > Is it the correct way or am I missing somewhat?


    This sounds like normal unix shell behaviour (which has also bitten me
    many times).

    The * and ? characters are wildcards which the shell tries to expand
    before invoking the expr command.

    * alone means all files in current directory.

    You should try

    echo expr 10 * 10

    to see what actually is invoked as it may clarify things.

    For me

    expr 10 "*" 10

    works.
    --
    Thorbj°rn Ravn Andersen

  3. Re: qsh and expr utility

    Thorbjoern Ravn Andersen wrote:
    > "Dr.UgoGagliardelli" writes:
    >
    >> I would like to use such a command
    >> expr 10 * 10
    >> and woul like to get 100 as a result while I'm getting
    >> expr: 001-0060 Errore di sintassi durante la valutazione
    >> dell'espressione: operando non trovato.
    >> (sintax error: operand not found)
    >> To get the correct result I must escape some operators, e.g.
    >> expr 10 \* 10
    >> gives the correct result.
    >> Is it the correct way or am I missing somewhat?

    >
    > This sounds like normal unix shell behaviour (which has also bitten me
    > many times).
    >
    > The * and ? characters are wildcards which the shell tries to expand
    > before invoking the expr command.
    >
    > * alone means all files in current directory.
    >
    > You should try
    >
    > echo expr 10 * 10
    >
    > to see what actually is invoked as it may clarify things.

    Correct, it expands to all file names in the current directory.
    >
    > For me
    >
    > expr 10 "*" 10
    >
    > works.

    It works for me too, as \* did. So the documentation is wrong.

    Thank you very much.

    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherA˝e joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vŃo Ó merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

+ Reply to Thread