• [^] # Re: Re-écriture du script

    Posté par (site web personnel) . En réponse au message Comportement bizarre de redirection en ksh. Évalué à 2.

    En fait cela pourrait être un truc comme ca : How can i send stdout to multiple commands

    En gros il voulait utiliser la syntaxe de tee qui permet d'envoyer ce qu'il reçoit a plusieurs destinations
    et dans certain il est possible de substituer la destination avec une commande.

    Process substitution
    If your shell is ksh93, bash or zsh, you can use process substitution.
    This is a way to pass a pipe to a command that expects a file name.
    The shell creates the pipe >and passes a file name like /dev/fd/3 to the command.
    The number is the file descriptor that the pipe is connected to. Some unix variants do not support /dev/fd; on
    these, a named pipe is used instead (see below).

    tee >(command1) >(command2) | command3

    Le truc permet d'éviter d'utiliser un fichier fifo.
    Doit y avoir moyen de faire plus simple et plus facile a maintenir :)