http://qs321.pair.com?node_id=11101358


in reply to Re: Sort alphabetically from file
in thread Sort alphabetically from file

I had no idea the Unix sort could do that. Thanks for posting. I've used GNU Utilities for Win32 before but it hasn't been updated since 2003 and is getting hard to find. I found a new project with the same objective called GNU on Windows that looks promising.

From reading the Wikipedia page for Sort it looks like the left angle bracket redirect, '<', isn't needed to read the input file. Also, I noticed that Windows Server 2012 includes a command called sort that doesn't have the -k option. That's a pity since not only does it have less functionality than the Unix version but also it complicates setting up a path to the GNU version with the same name.

Replies are listed 'Best First'.
Re^3: Sort alphabetically from file
by Fletch (Bishop) on Jun 14, 2019 at 17:09 UTC

    If you're stuck in Wintendo land there's also Cygwin which has the GNU stuff and lots of other open source stuff.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      I shifted from cygwin to MSYS2 some time ago, although I am increasingly using the Windows Subsystem for Linux on Win10 boxes. That said, I use them in isolation so none of them are in my windows path.

      The PerlPowerTools might also be useful, although I have never tried them myself.

        I just tried to install them and cannot get past installation errors of DB_File. It needs BerkeleyDB header files apparently and have not had time to look into getting any of it installed. would be cool, but with WSL/bash incorporated in win10 already, i dont really see a need for it unless some programs work that WSL does not yet support.

        EDIT: got them installed on windows. seems to work for the most part (grep, ls, diff) will need to test them further. I had to force install after trying for hours to install DB::File unsuccessfully. Kept getting undefined reference errors about db_version and db_create and tried to track it down but could not unfortunately.
      I stopped installing cygwin since I discovered git's bash terminal is supporting most of bash

       ls -l | grep NT | sort -k5

      works fine for me! :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        Why install most of bash (GIT) when you can install WSL? It works great for just about everything I have needed to do, and also has updated perl.

      Yes, I've used Cygwin for years on my personal laptops but it isn't an option for me at work on corporate Windows servers. Up until ten years ago one of our software vendors was including the GNU Utilities on certain machines but that is no longer the case. I end up reinventing the GNU wheels. Would those be GNU-er wheels?