Sed ajout en fin de commande script shell
Résolu/Fermé
A voir également:
- Sed -n shell
- Classic shell windows 10 - Télécharger - Personnalisation
- Sed supprimer ligne - Astuces et Solutions
- Shell addition ✓ - Forum Shell
- Shell pause ✓ - Forum Shell
- Sed supprimer ligne vide - Forum Linux / Unix
1 réponse
zipe31
Messages postés
36316
Date d'inscription
dimanche 7 novembre 2010
Statut
Contributeur
Dernière intervention
27 janvier 2021
6 542
16 août 2018 à 13:31
16 août 2018 à 13:31
Salut,
;-))
$ cat brol
echo lolpass1
ping 127.0.0.1 -c 2
echo testcom #commentaires
echo "test"
$ sed "/^$/! s/^[^#]*/& \&\& echo '& : OK' >> result.txt || echo '&' >> errors.log/" brol
echo lolpass1 && echo 'echo lolpass1 : OK' >> result.txt || echo 'echo lolpass1' >> errors.log
ping 127.0.0.1 -c 2 && echo 'ping 127.0.0.1 -c 2 : OK' >> result.txt || echo 'ping 127.0.0.1 -c 2' >> errors.log
echo testcom && echo 'echo testcom : OK' >> result.txt || echo 'echo testcom ' >> errors.log#commentaires
echo "test" && echo 'echo "test" : OK' >> result.txt || echo 'echo "test"' >> errors.log
;-))
16 août 2018 à 13:47