• # heu ...

    Posté par . En réponse au journal Un meilleur shell. Évalué à 1.

    C'est pas pour etre mechant, mais tout les shell ne se comportent pas comme bash.

    exemple :

    voila un ptit code code python :


    #!/usr/bin/python
    import sys

    if len(sys.argv) != 4 :
    print "pas 3 arguments : %d argument"%(len(sys.argv) - 1)
    else :
    print "3 arguments"

    print str(sys.argv[1:])


    en bash comme prevu :

    $ var="mot1 mot2"
    $ python test.py a b${var}c d
    pas 3 arguments : 4 argument
    ['a', 'bmot1', 'mot2c', 'd']


    mais en zsh (le seul le grand l'unique)

    tmp/jeu %var="mot1 mot2"
    /tmp/jeu % ./test.py a b${var}c d
    3 arguments
    ['a', 'bmot1 mot2c', 'd']


    Donc en zsh .. ben ca marche