Rediriger dans une variable la sortie STDERR en SHELL


SORTIE=`tar -czvf /home/MonHome.tar.gz /tmp/ 2>&1`

Tu as dans $SORTIE ce que t’a renvoyé la commande tar.
echo $SORTIE

Autres articles intéressants :

  1. Remplacer des mots dans plusieurs fichiers
Leave a Comment