• [^] # Re: Débuggage

    Posté par . En réponse au message Exercice shell script. Évalué à 2.

    Oui. Je ne sais pas d'où je tiens ça...

    http://stackoverflow.com/questions/9449778/what-is-the-benefit-of-using-instead-of-backticks-in-shell-scripts

    À priori il n'y a pas de différence fonctionnelle mais ils ne s'utilisent pas pareil, certains caractères ne sont pas interprété pareil.

    Sur stackoverflow la réponse qui revient pas mal c'est que les $() peuvent être imbriqués, ce à quoi quelqu'un répond qu'on peut aussi imbriquer les `` mais que c'est assez moche :

    Suppose you want to find the lib directory corresponding to where gcc is installed. You have a choice:

    libdir=$(dirname $(dirname $(which gcc)))/lib
    libdir=`dirname \`dirname \\\`which gcc\\\`\``/lib
    

    The first is easier than the second - use the first.