Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hou3c.UUCP Path: utzoo!watmath!clyde!burl!hou3c!ka From: ka@hou3c.UUCP (Kenneth Almquist) Newsgroups: net.unix,net.unix-wizards Subject: Re: sort problems Message-ID: <1007@hou3c.UUCP> Date: Mon, 21-Jan-85 17:04:58 EST Article-I.D.: hou3c.1007 Posted: Mon Jan 21 17:04:58 1985 Date-Received: Wed, 23-Jan-85 04:39:32 EST References: <2040@pegasus.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 26 Xref: watmath net.unix:3406 net.unix-wizards:11663 > Okay you sort experts why do these two sorts not work ? > > sort << ! > Abe > Aba > ! > > With no matter what combination of sort options I use > I can't Aba to come out first (except of course -r). Try "sort -b +0". The +0 causes it to sort on the first field, and the -b causes it to ignore leading blanks in determining the start of the first field. > sort << ! > Abe > $Aba > ! > > The '$' seems to screw something up and it comes back with that line empty. This has nothing to do with sort. The shell will normally expand shell variables inside text included by "<<". Since $Aba has not been set, it is replaced with the null string. To suppress this behavior, substitute "<<\!" for "<