Oh for sure and - on just about any other system i tried, -n is absolutely 
necessary

Better yet most linux distros have a -h on sort which is awesome and seamlessly 
tackles du -sh (human readable output) - sorting things like 8M and 8G in their 
proper place.  Get with it OMVS :)

d:/usr$ du -sh *|sort -h
4.0K    games
8.0K    default
36K     var
224K    src
47M             sbin
82M            include
112M    local
500M    bin
3.3G    lib
4.0G    share


I always feel like i have to backtrack skills learned over decades of other 
‘nix’s when using OMVS .. would be nice to have a modern complement of tools 
and switches.

Chad
> On Feb 19, 2016, at 10:48 AM, Paul Gilmartin 
> <0000000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
> 
> On 2016-02-19, at 09:26, Bigendian Smalls wrote:
>> 
>> I’m a big proponent of using the switches to be sure and accurate , but in 
>> the case of the output of du I can’t see where it makes a difference. ...
>> 
> I'll agree with you about output of du.  Testing on an OS X system 
> with signed numbers:
> 
> 639 $ echo "
> 1
> -1
> 2
> -2
> 3
> -3 " | sort
> 
> -1
> -2
> -3 
> 1
> 2
> 3
> 640 $ 
> ... not a very good numeric sort.  But:
> 640 $ echo "
> 1
> -1
> 2
> -2
> 3
> -3 " | sort -nk1,1
> -3 
> -2
> -1
> 
> 1
> 2
> 3
> 641 $ 
> 
> So, "to be sure and accurate", or perhaps just by habit, I use
> "-nk" for numeric sorting.  Don't know about floating point or
> scientific or engineering notation.  Or about DFSORT.
> 
> -- gil
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to