Never use $1 unless it's within the context of a conditional based on the success of the match.
Otherwise, you get the previous match. In this case, an empty line would give you a duplicate "first" word from the previous entry!
-- Randal L. Schwartz, Perl hacker
In reply to RE: RE: RE: Re: Help for awk/regex/newbie
by merlyn
in thread Help for awk/regex/newbie
by cmenser
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |