This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Running Windows scripts & PATHEXT


Igor Pechtchanski wrote:

Ugh. I fully agree with CGF - the "hide the extension" business is ugly, counterproductive, and should not be used.

Well Cygwin's already doing it WRT things like .exe and .lnk... :-)


Having said that, is there any reason why

$ ln -s myscript.pl myscript && chmod a+x myscript.pl

doesn't do the trick? AFAIK, Windows doesn't attempt to execute files with no extension, so it won't interfere with CMD, and will allow bash to execute myscript.pl by typing "myscript"...

Nah it'd work. Just that I'd have to create additional links for every myscript I come up with! That's what I was trying to avoid.


The situation with VB scripts is harder. I'd go for something like

$ cat > myscript << EOF && chmod a+x myscript
#!/bin/bash
cscript /nologo myscript.vbs
EOF

if you wanted to run "myscript.vbs" by just typing "myscript". FWIW, if there were a way to get Visual Basic to ignore the shebang line at the top, there's a way of specifying the right script interpreter, too, so that you could run "myscript.vbs" directly, but I guess VB will punt on that, so I won't go into details.

Well one thing that I did was create a .cmd file that runs the .vbs with cscript instead of wscript but again, having to create and maintain an additional file (myscript.cmd calls myscript.vbs with cscript) *plus* have to make a symlink for myscript -> myscript.cmd (would that even work?!? - your example was a symlink -> a .pl file not a .cmd that calls a .vbs, etc....) is just getting way to messy...



-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]