[Awk] Retour à la ligne

Résolu
camel -  
dubcek Messages postés 18627 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

J'ai le souci suivant je n'arrive pas à renvoyer à la ligne le résultat de ma variable qui est une commande et qui m'affiche tout d'un bloc malgrés l'utilisation du retour chariot:

DEPOTS=$(grep -i sms $FACTURE|grep -i "code_barre"|awk '{print $1,$2,$3,$13,$15,$16,$17,$18}' "\n" )

Merci de votre retour.
Configuration: Windows XP
Internet Explorer 6.0

3 réponses

  1. dubcek Messages postés 18627 Date d'inscription   Statut Contributeur Dernière intervention   5 660
     
    hello
    DEPOTS=$(grep -i sms $FACTURE|grep -i "code_barre"|awk '{print $1,$2,$3,$13,$15,$16,$17,$18 "\n"}' )
    3
  2. dubcek Messages postés 18627 Date d'inscription   Statut Contributeur Dernière intervention   5 660
     
    hello
    awk peut aussi remplacer grep:
    DEPOTS=$(awk 'BEGIN {IGNORECASE=1} ; /sms.*code_barre/ {print $1,$2,$3,$13,$15,$16,$17,$18 "\n"}' $FACTURE)
    ou
    DEPOTS=$(awk 'BEGIN {IGNORECASE=1} ; /code_barre.*sms/ {print $1,$2,$3,$13,$15,$16,$17,$18 "\n"}' $FACTURE)
    1
  3. camel
     
    Merci beaucoup ça marche,

    A bientôt!
    0