简体   繁体   中英

Windows/cygwin shebang line

I am using Sphinx quite often. There is one index that calls a stored procedure with one param as input. The param can be any number from 1 to 10 and each returs different results. Since it would make sphinx config quite crowded, even with inheritance. So I thought I will use shebang line at the start of sphinx config file (stored as sphinx.py now). This works great in production enviroment since it runs on Ubuntu. But I want to run it on my local machine as well, but here is the problem called - Windows. Since I have cygwin as well, I tried to run it via cygwin, but it is the same - nothing happens.

I tried to run with both cygwin paths and windows paths, but both get ignored or treated as comments. From what I have read it should be working with cygwin. Could it be that it does not work since I have to call an exe file?

With:

$ ./indexer.exe sphinx.conf

I have tried to run it as perl script, bash script (via cygwin) and it gets ignored either way.

Is there a reliable way to run shebang lines on Windows? Or force cygwin to at least spit an error in my face... Even hacks are good since its just my development machine.

Any help is appreciated

All a shebang line does is tell the unix system() call what interpreter to use. If you specify indexer.exe then you are saying that you want it to use indexer.exe, so that is what it will use.

If you run Indexer.exe, indexer.exe will decide what to do.

Does Indexer.exe understand shebang lines? Or not?

Perl, as a convenience , will read the shebang line, and if it isn't Perl, it will and call the other program for you.

So maybe call Perl instead of Indexer, and it will do the right thing?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM