From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: thermate Newsgroups: gmane.emacs.help Subject: Re: uniq without sort <-------------- GURU NEEDED Date: Mon, 28 Jan 2008 08:51:36 -0800 (PST) Organization: http://groups.google.com Message-ID: <6d2c7772-dab4-4f5a-94df-85f241fe3347@j78g2000hsd.googlegroups.com> References: <08698dfa-d5dc-484d-a5fb-fe84bb0d2893@s13g2000prd.googlegroups.com> <7d849d0c-9d8e-44e9-b461-38657fae0a7d@b2g2000hsg.googlegroups.com> <5462c3ef-cb53-40d8-8a96-bbf624408300@v4g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1201545777 3877 80.91.229.12 (28 Jan 2008 18:42:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jan 2008 18:42:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 28 19:43:18 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JJYwj-00068I-1g for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Jan 2008 19:43:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJYwI-0008Eh-6S for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Jan 2008 13:42:38 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!j78g2000hsd.googlegroups.com!not-for-mail Original-Newsgroups: comp.unix.questions, comp.unix.shell, gnu.emacs.help, comp.text.tex, sci.chem Original-Lines: 167 Original-NNTP-Posting-Host: 75.28.155.233 Original-X-Trace: posting.google.com 1201539096 13735 127.0.0.1 (28 Jan 2008 16:51:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 28 Jan 2008 16:51:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j78g2000hsd.googlegroups.com; posting-host=75.28.155.233; posting-account=9ddq4goAAADsdvyTPqxttM-gEBbJHq3d User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30),gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu comp.unix.questions:155245 comp.unix.shell:213805 gnu.emacs.help:155647 comp.text.tex:365664 sci.chem:320904 X-Mailman-Approved-At: Mon, 28 Jan 2008 13:37:43 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51037 Archived-At: On Jan 26, 6:35=A0pm, gnuist...@gmail.com wrote: > cat input|awk '!_[$0]++' =A0 =A0<---- =A0 I am interested in understanding= > this and other one liners. I show you equivalences line by line with reason for each equivalence in comment uniq without sort - a one liner w/o any pipes - based on associative array or symbol-value-table ----------------- NOTE: In tcsh each instance of NOT or ! must be replaced by \! ie, escaped. # echo -e "a\nc\nd\nb\nc\nd\nc" | # the input data awk ' ! count [ $0 ] ++ ' <=3D> # print $0 is the default action awk '!_[$0]++' <=3D> # _ is cryptic name of associativ array awk ' !_[$0]++ { print $0 } ' <=3D> # pattern action or true action awk ' /.*/ { if ( !_[$0]++ ) { print $0 } } ' <=3D> # /.*/ is any pattern, but not /*/ awk ' /.*/ { if ( !_[$0]++ !=3D 0 ) { print $0 } } ' <=3D> # like C zero is the only false in awk awk ' /.*/ { if ( _[$0]++ =3D=3D 0 ) { print $0 } } ' <=3D> ## NOTE all /.*/ can be omitted everywhere awk ' /.*/ { if ( ++_[$0] =3D=3D 1 ) { print $0 } } ' <=3D> awk ' { _[$0]++ ; if ( _[$0] =3D=3D 1 ){ print $0 } } ' <=3D> # omitting= default pattern /.*/ awk ' /.*/ { a[$0]++ ; if ( a[$0] =3D=3D 1 ){ print $0 } } ' # associative array a[index] where # index is the line and value is the # count. only if count=3D=3D1 then print. perl -ne ' if ( ! $count{ $_ } ++ ){ print $_ } ' # perl has $count{} and $_ and does not # assume pattern, so no outer {} Now some lesson on history: First the speech by Mr Benjamin H Freedman at http://iamthewitness.com ??? Understanding the MOTIVE FORCE of World History from horse's mouth itself - Mr. Benjamin H Friedman was a GENIUS ??? Full Article: http://iamthewitness.com/FreedmanFactsAreFacts.html <-------- KEY DOCUMENT Steamy Excerpts: Will you be patient with me while I review here as briefly as I can the history of that political emergence and disappearance of a nation from the pages of history? In the year 1948 in the Pentagon in Washington I addressed a large assembly of the highest ranking officers of the United States Army principally in the G2 branch of Military Intelligence on the highly explosive geopolitical situation in eastern Europe and the Middle East. Then as now that area of the world was a potential threat to the peace of the world and to the security of this nation I explained to them fully the origin of the Khazars and Khazar Kingdom. I felt then as I feel now that without a clear and comprehensive knowledge of that subject it is not possible to understand or to evaluate properly what has been taking place in the world since 1917, the year of the Bolshevik revolution in Russia. It is the "key" to that problem. Upon the conclusion of my talk a very alert Lieutenant Colonel present at the meeting informed me that he was the head of the history department of one of the largest and highest scholastic rated institutions of higher education in the United States. He had taught history there for 16 years. He had recently been called back to Washington for further military service. To my astonishment he informed me that he had never in all his career as a history teachers or otherwise heard the word "khazar" before he heard me mention it there. That must give you some idea, my dear Dr. Goldstein, of how successful that mysterious secret power was with their plot to "block out" the origin and the history of the Khazars and Khazar Kingdom in order to conceal from the world and particularly Christians the true origin and the history of the so-called or self- styled "Jews" in eastern Europe. FBI bastards, where is the anthrax mailer ????? Using full names and fake telephone nos or addressses to get our trust, names from France, Germany, Italy, finland and other countries, yank bastards from the 911 controlled demolition group, which spread lies and disinformation right on and after 911 is doing their evil work of sabotaging useful discussions on the internet. These corporatist evil ones believe in DIVIDING us. They are EVIL BASTARDS. FBI never caught the anthrax mailer with fake letter and military grade anthrax because that was one of these yank bastards they were afraid to catch. please click on my profile under google groups to see videos about these yank bastards. these bastards use multiple nicks to deceive you. subtle derailment of threads, casting aspersions is their methodology. watch alex jones "terror storm" and other videos to learn what these evil bastards are upto and how they have perfected psychological techniques to manipulate you. On newsgroups there one and only one goal is to divide people and make them slave to corporations. Subject: Re: RACIST YANK BASTARDS FROM 911 CONTROLLED DEMOLITION GROUP SABOTAGING INFORMATIVE THREADS subtle derailment of threads, by casting aspersions is their methodology, using multiple nicks with fake identities, using sophisticated software and a network of proxies and remailers including TOR is their methodology. please watch alex jones video terror storm and see how these bastards using techniques by Edward Bernays who was Freud's nephew. subtle derailment of threads, by casting aspersions is their methodology subtle derailment of threads, by casting aspersions is their methodology subtle derailment of threads, by casting aspersions is their methodology subtle derailment of threads, by casting aspersions is their methodology Monica Lewdinsky Valery Plame Wilson <---- michelle blonde evil yank whose goal was various sabotages Newton Gingrich <---- BiBBle waving ADULTERER, yank bastard What about the CHILD MOLESTERS ? What about the one who goes in MINNESOTA tapping adjacent bathroom cells for gay sex ? :)))))