Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • As tagged bash, parameter expansion based solution can be shorter when used on array: pastebin.com/kgq89527 Commented Aug 21, 2013 at 8:25
  • 1
    @manatwork Beautiful. I would say this merits to be in answer of its own with a short explanation perhaps... Commented Aug 21, 2013 at 8:41
  • However note that performance will be very poor on big files as anything using loops in bash, and that assumes all lines contain one @ and one _ before the left-most @ (and the other usual problems when using read with -r and without setting IFS) Commented Aug 22, 2013 at 20:01