Skip to content

Instantly share code, notes, and snippets.

@nelanka
Created October 24, 2014 13:38
Show Gist options
  • Save nelanka/819d05688c3304dc1a49 to your computer and use it in GitHub Desktop.
Save nelanka/819d05688c3304dc1a49 to your computer and use it in GitHub Desktop.
Grep-Fu!
grep -o '.\{0,20\}test_pattern.\{0,20\}' –
portion on left is how many characters before match and portion on right is how many characters after match
using this to pull out unique RICS from a json string where they are suffixed by the text (RIC)
grep -o '.\{0,7\}(RIC).\{0,0\}' junitResult.xml | uniq | sort | cut -d " " -f 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment