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: [BUG?] run.exe and pdflatex


On Fri, 11 Jan 2008, Sven Köhler wrote:

> > Now, in Cygwin 1.7.x (a.k.a. CVS HEAD), this is no longer the case
> > (since revision 1.243 of spawn.cc).  The comment simply says "Drop
> > pty_needs_alloc_console check" -- maybe Corinna can explain why it was
> > dropped.  So your program will not work as expected in the snapshots.
>
> OK, thanks for the explanation.
>
> But ... wouldn't that mean that any command executed would open a
> console window?

Yes, unless one is already allocated.  So, when you run cygwin.bat, that
opens the console, and this console is used for subsequent apps.  However,
if you tried to invoke a Cygwin application via Start->Run, you'd get a
console.

> In your other responses, you said, that using the shell is the most
> preferrable way. Unfortunatly, i cannot use the shell. The method is
> well understood. I could easily execute cygwin stuff by using:
>
> bash -c "exec \"\$0\" \"\$@\"" program param1 param2 ...
>
> The program from which i want to execute pdflatex/pslatex/etc. (which is
> Texlipse, a Latex plugin for Eclipse) doesn't allow me to do so.

Yet it would allow you to use run.exe in place of bash -c 'exec "$0"
"$@"'?  This is weird.

> But aside from that: is the shell really the preferred way of doing
> this? Doesn't the shell simply call execve again?

Not quite.  The shell will also set the right program name for
executables/symlinks, or interpret the shebang line and invoke the
interpreter via execve, rather than the script.

> Following what you said, it should be best to call bash.exe from run.exe
> to solve all the issues.

Indeed.  So, your invocation would be

run bash -c 'exec "$0" "$@"' pdflatex your args

or something like that.


> So the question is: who does all the checks (shebang, etc.)?
> - the execve implementation? (which is cygwin, right?)
> - the shell?
> - both?

The shell.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"That which is hateful to you, do not do to your neighbor.  That is the whole
Torah; the rest is commentary.  Go and study it." -- Rabbi Hillel
--
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]