Sed ajout en fin de commande script shell
Résolu/Fermé
A voir également:
- Sed -n shell
- Classic shell windows 11 - Télécharger - Personnalisation
- Shell startup windows 10 - Guide
- Ssh secure shell download - Télécharger - Divers Web & Internet
- Sed supprimer ligne - Astuces et Solutions
- Shell infrastructure host c'est quoi - Guide
1 réponse
zipe31
Messages postés
36402
Date d'inscription
dimanche 7 novembre 2010
Statut
Contributeur
Dernière intervention
27 janvier 2021
6 422
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