[Novalug] Need sort script
James Ewing Cottrell 3rd
JECottrell3 at Comcast.NET
Mon Dec 6 00:36:49 EST 2010
On 12/5/2010 7:08 PM, Geoff McNamara wrote:
> <flame bait mode>
> I *did* write this in PERL and submitted to the list first,
> .... but knowing that PERL came from the merits of awk, sed, and grep
> (because they exist on all *nix systems)
> and most importantly .....
Check the group line. It says LINUX, not UNIX. Besides, what admin worth
their salt wouldn't
> <raising flame to a new level>
> knowing that if you fail to learn awk, sed, and grep - you are
> doomed to having all you your PERL scripts re-written when you
> leave you current work location....
> </raising flame to a new level>
Why would they be rewritten? Grep and sed yes, but Perl is a superset of
awk. Just learn Perl.
> PERL is great but must be installed, maintained (meaning all needed
> modules and libraries loaded), and must be supported by someone who has
> the same "style" as the author...
Any admin worth their salt would install Perl on any UNIX system that
didn't have it. And these days, they pretty much all do.
As for Style, that is the same in any language.
> My apologies ----- flame bait was taken, hooked, swallowed, and dragged
> out of the water....
> </flame bait mode>
>
> Sorry for going off on a tangent ... (My mentors were all unix
> fundamentalists [thank you to all of them] )
> Enjoy.....
> -g-
I am a fundamentalist too. Learn Perl, rm awk.
JIM
>
>
> On 12/05/2010 11:43 AM, James Ewing Cottrell 3rd wrote:
>> On 12/2/2010 5:02 PM, Jon LaBadie wrote:
>>> On Thu, Dec 02, 2010 at 01:48:14PM -0700, geoffm at companionway.net wrote:
>>>> Just for grins I wrote an awk code snippet which I *think* does this as
>>>> well:
>>>> awk 'BEGIN{RS="GO"}
>> Did you mean Perl? Don't write awk scripts!
>>>> {
>>>> data[$RN]=$0;
>>> data[NR]=$0; # did you mean NR?
>>>
>>>> }
>>>> END {
>>>> n=asort(data);
>>>> for(i=1;i<=n;i++)
>>>> {
>>>> print data[i];
>>>> }
>>>> }' myfile.sql
>>>>
>>>> Double - triple check me as my QA department is always out to lunch :)
>>>> Geoff
>> _______________________________________________
>> Novalug mailing list
>> Novalug at calypso.tux.org
>> http://calypso.tux.org/mailman/listinfo/novalug
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.872 / Virus Database: 271.1.1/3298 - Release Date: 12/05/10 02:34:00
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://calypso.tux.org/pipermail/novalug/attachments/20101206/eb57ec16/attachment.html
More information about the Novalug
mailing list