4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
1 results tagged exit x
  • thumbnail
    regex - Bash: One-liner to exit with the opposite status of a grep command? - Stack Overflow

    La commande eb d'amazon retourne toujours 0 même quand elle foire.. pas pratique pour repérer une erreur dans les script de CI..

    Mes scripts bash commencent tous avec "set -e" pour sortir en erreur des qu'il y a un probleme

    La commande eb me pose donc problème, j'ai fixé ça de cette mainère en attendant de trouver mieux :

    eb blablabla 2>&1 | ( ! grep ERROR)

    De cette manière, si dans le stdout ou dans le stderr on trouve 'ERROR', le grep va matcher et renvoyer 1 (dans une utilisation normale, grep retourne 0 si il match, mais avec le point d'exclamation, on inverse ce retour)

    Ce qui aura pour effet de passer mon script en erreur !

    January 4, 2017 at 10:46:12 AM GMT+1 - permalink - archive.org - http://stackoverflow.com/questions/15367674/bash-one-liner-to-exit-with-the-opposite-status-of-a-grep-command
    code error exit grep status
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation