>>>>> "Len" == Len Conrad <[email protected]> writes:
Len> I readfile or pipe this text, in any line order:
Len> rm90.steampick.info
Len> fgce172.lanejive.info
Len> smailer1.service.govdelivery.com
Len> fl49.orangetalon.info
Len> pollux.carespecial.info
Len> into a program to remove subdomains down to domain.tld :
Len> awk 'FS="." { print $(NF-1)"."$NF }'
Len> and get the first line doubled rather than processed like the other lines:
Len> rm90.steampick.info.rm90.steampick.info
Len> lanejive.info
Len> govdelivery.com
Len> orangetalon.info
Len> carespecial.info
Yes, that would be the expected behavior.
You need to set the FS *before* processing the first line.
Either use -F ., or a BEGIN block.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"