Skip to content

Instantly share code, notes, and snippets.

@ivanrosolen
Created January 12, 2016 19:59
Show Gist options
  • Save ivanrosolen/7857a69122c013f6332b to your computer and use it in GitHub Desktop.
Save ivanrosolen/7857a69122c013f6332b to your computer and use it in GitHub Desktop.
Pegar apenas um número do output (multiline) de um comando
Output:
lero lero
lero lero
bla bla bla (ASSET ID: 85) time 12
comando 2>&1 | sed -E 's,.+: ([0-9]+)\).+,\1,g' | tail -n1
Resultado:
85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment