Web lists-archives.com

[Mingw-msys] Info when installing MinGW-4.1.0.exe

On Friday 01 August 2008 02:45:15 JonY wrote:
> Sun, Xiuxin wrote:
> > Could someone advise where to get the cmd 'more' ?
> MSYS has "less", it works the same way. Have you tried it?

Like JonY said, use less; it's a typical free software pun: "less is 
more than more".

However, I was rather surprised by this question, since Microsoft 
actually do provide `more' as a standard Windows command; it is one of 
the MS-DOS legacy commands, in the $SYSTEMROOT/system32 directory, but 
the guys at Microsoft have very naughtily called it `more.com' instead 
of `more.exe', (even though it is most definitely *not* a .com format 
binary, and *is* PE .exe format).  It is this misnaming that prevents 
MSYS from finding it.

You will not want to use it, because `less' is so much more useful, but 
just for fun, I've put together this shell script, to illustrate how to 
invoke such brain damaged Microsoft tools from MSYS:

  # File: /bin/more
  # Invoke Windows' more.com from MSYS:
  # Note that we have to convert all MSYS path names to Windows
  # format, using `\' and not `/' as the dirsep character; also,
  # on the MSYS command line, we must use double `//' for the
  # switch character -- it will be passed as `/' to more.com
      local dirsep="" windir=`dirname -- "$1"` remnant=""
      until 2> /dev/null cd "$windir"
        remnant=`basename -- "$windir"`$dirsep$remnant
        dirsep=\\ windir=`dirname -- "$windir"`
      echo "`pwd -W | tr / \\\\`$dirsep$remnant"
      local dirname=`windirname "$1"` filename=`basename -- "$1"`
      echo "$dirname\\$filename"
    for arg
      case $arg in
        //*) argv=$argv$space$arg ;;
          *) argv=$argv$space$quote`winpath "$arg"`$quote ;;
      space=" "
    eval more.com "$argv"
  # /bin/more: end of script


This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Mingw-msys mailing list