sort problems

Kenneth Almquist ka at hou3c.UUCP
Tue Jan 22 08:04:58 AEST 1985


> 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 "<<!".  See sh(1) for more details.
					Kenneth Almquist



More information about the Comp.unix mailing list