Alias for internal command

Jun 8, 2013
98
0
Warsaw, Poland
[I'm trying to use MSYS together with TCC]

I want to use an external command (exe file) instead of internal.
For example: dir.exe

I expect to get something like that:
DIR - executes specific dir.exe
*DIR - executes TCC' DIR command.

So let's alias:
alias dir="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"

"*dir" works fine
In most cases "dir" works fine, too, but

DIR. (DIR and a dot without space) still calls internal command
DIR.mydata" (without space) executes internal "DIR .mydata"

It can be partially fixed:
alias dir.*="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
In that case
dir. invokes external dir.exe (I'm not sure if a dot is passed as %1), but dir.mydata still invokes internal dir command.

So
alias dir.*="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
works exactly as
alias dir.="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe" (without asterisk)
 
It seems like there's nothing to fix. The name of an EXE followed by a dot with no space never works the as you wish.
Code:
c:\windows\system32> ftp.
TCC: Unknown command "ftp."

c:\windows\system32> netstat.
TCC: Unknown command "netstat."

g:\tc16> tcc.
TCC: Unknown command "tcc."
 
Ech. There is some misunderstanding.

Lets make the same aliases for commands DIR and XIR
alias dir="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
alias xir="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
alias dir.*="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
alias xir.*="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"

Let.s make directory (with leading dot)
mkdir .test

and:
dir.test: executes (internal) "dir .test"
xir.test: Unknown command "xir.test"
 
Ech. There is some misunderstanding.

Lets make the same aliases for commands DIR and XIR
alias dir="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
alias xir="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
alias dir.*="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"
alias xir.*="z:\P Apps\PortableApps\CommonFiles\MSYS\App\msys\bin\dir.exe"

Let.s make directory (with leading dot)
mkdir .test

and:
dir.test: executes (internal) "dir .test"
xir.test: Unknown command "xir.test"
That all seems right to me. The first token on a command line is supposed to be followed by a space. Rex has (reluctantly) allowed some perversions in the case of internal commands to pacify a few who insist on not using correct syntax.
 

Similar threads