lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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:
#!/bin/sh
#
# 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
#
windirname()
{
local dirsep="" windir=`dirname -- "$1"` remnant=""
until 2> /dev/null cd "$windir"
do
remnant=`basename -- "$windir"`$dirsep$remnant
dirsep=\\ windir=`dirname -- "$windir"`
done
echo "`pwd -W | tr / \\\\`$dirsep$remnant"
}
winpath()
{
local dirname=`windirname "$1"` filename=`basename -- "$1"`
echo "$dirname\\$filename"
}
quote='"'
for arg
do
case $arg in
//*) argv=$argv$space$arg ;;
*) argv=$argv$space$quote`winpath "$arg"`$quote ;;
esac
space=" "
done
eval more.com "$argv"
#
# /bin/more: end of script
Regards,
Keith.
-------------------------------------------------------------------------
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
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys