• [^] # Re: shell touch

    Posté par (site web personnel) . En réponse au journal La sortie de `ls` vient de changer. Évalué à 4.

    C'est pas du tout beau et en plus, tu crée toujours un nouveau fichier alors que touch ne crée un nouveau fichier QUE si celui-ci n'existe pas. En plus, cela semble vachement sh dépendant (cf zsh ci dessus). Du coup, j'ai partiellement regardé le man de bash

    "
    If the redirection operator is >, and the noclobber option to the set builtin has been enabled, the redirection will fail if the file whose name results from the expansion of word exists and is a regular file. If the redirection operator is >|, or the redirection operator is > and the noclobber option to the set builtin command is not enabled, the redirection is attempted even if the file named by word exists.
    "

    Bon, je vais rester avec mes "touch" ;-)