[Tutor] Re:[Tutor]Question on python

Magnus Lycka magnus@thinkware.se
Thu Nov 21 07:34:01 2002


At 06:01 2002-11-21 +0530, sachin mehra wrote:
>Well I want to use the following commands:
>tr -cs '[:aplha:]' '[\n*]' < *.txt | uniq -c | sort -rm | more

First of all, you must have a "sort" before "uniq", and I think
you mean "sort -rn", not "sort -rm".

I can't imagine that you want the 'more' part if you intend to
use the output in a python script though.

I'm not sure it's a good idea to make these kinds of mixing
language shortcuts. This is certainly more compact than the
corresponding solution in python, which would probably land
on ten lines or so, but I think it's more difficult to
maintain. The maintainer has to manage two different
languages, at the same time. It's certainly less portable!



-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se