Skip to content

Instantly share code, notes, and snippets.

@quickgrid
Created April 1, 2016 03:22
Show Gist options
  • Save quickgrid/8ab3875e036efe335f0f445c1cd635e4 to your computer and use it in GitHub Desktop.
Save quickgrid/8ab3875e036efe335f0f445c1cd635e4 to your computer and use it in GitHub Desktop.
The code below gets lines 5 to 10 from input file and perform the given email address regular expression and show the exact match output on console.
#!/bin/bash
head -10 "EmailAddress.txt" | tail -6 | grep --color -E -w "^[A-Za-z0-9._]+@[A-Za-z0-9.]+\.[A-Za-z]{2,6}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment