ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>,
	"Hans Hagen" <pragma@wxs.nl>
Subject: Re: Problem calling system
Date: Tue, 15 May 2012 10:34:52 +0200	[thread overview]
Message-ID: <op.weccsetstpjj8f@lpr> (raw)
In-Reply-To: <4FB2107B.2090008@wxs.nl>

> probably some os.execute parsing ...

Do you mean Lua itself does the parsing and substitution? I guessed [lua]tex core...

When I try to call on the command line:

"
C:\Lukas\ConTeXt\TestDDv>lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> os.execute([[lua -e "print 'WWW'"]])
WWW
> os.execute([[echo lua -e "print 'WWW'"]])
lua -e "print 'WWW'"
> =os.exec
nil
> =os.spawn
nil
>
"

- There is no '/" substitution in standalone Lua (?!).

> does os.exec or os.spawn work ok?

Well, the 'os.exec' works, in condition that it is called with "cmd /c":

----
\ctxlua{os.execute([[echo lua -e "print 'EXECUTE'"]])}
\ctxlua{os.exec([[cmd.exe /c echo lua -e "print 'EXEC'"]])}
\ctxlua{os.spawn([[cmd.exe /c echo lua -e "print 'SPAWN'"]])}

\starttext
   A
\stoptext
----

Gives:

"
...
languages       > language en is active
lua -e "print "EXECUTE""
lua -e "print 'EXEC'"

system          | total runtime: 0.609
"

Interesting that the string to be passed to 'os.exec' keeps ' whilst that to 'os.execute' doesn't.

Why this happens?

Anyhow, thanks for the idea with 'os.exec'.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2012-05-15  8:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14  8:56 Procházka Lukáš Ing. - Pontex s. r. o.
2012-05-14 10:11 ` Hans Hagen
2012-05-14 10:23   ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-05-14 10:54     ` Hans Hagen
2012-05-15  7:05     ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-05-15  8:14       ` Hans Hagen
2012-05-15  8:34         ` Procházka Lukáš Ing. - Pontex s. r. o. [this message]
2012-05-15  9:31           ` Hans Hagen
2012-05-15 11:46             ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-05-15 13:19               ` luigi scarso
2012-05-17  8:52           ` Procházka Lukáš Ing. - Pontex s. r. o.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.weccsetstpjj8f@lpr \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).