Skip to content

Instantly share code, notes, and snippets.

@rctay
Created January 19, 2012 07:35
Show Gist options
  • Save rctay/1638601 to your computer and use it in GitHub Desktop.
Save rctay/1638601 to your computer and use it in GitHub Desktop.
[awk] print comma-separated NUS emails
#!/bin/awk
# a1234567b@nus is not a valid address, but a1234567@nus is. Hence this
# script.
# Expects: lines of nus matric no, like a1234567[...]
# Outputs: comma-separated nus email addresses on a single line, like
# [email protected],[...]
{ printf "%[email protected],", substr($0,0,8) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment