Re: [NTG-context] mtxrun exit code

2020-05-29 Thread Marco Patzer
On Fri, 29 May 2020 11:20:22 +0200
Hans van der Meer  wrote:

> I am producing a series of files in a shell script with mtxrun
> --autogenerate --script context input Doing exit mtxrun... shows
> there is no exit number to test in the shell

The exit code from mtxrun works here:

printf '%s\n' '\bye' > good.tex && mtxrun --autogenerate --script context 
good.tex; echo $?
0

printf '%s\n' '\by' > bad.tex && mtxrun --autogenerate --script context 
bad.tex; echo $?
1

Marco
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] mtxrun exit code

2020-05-29 Thread Hans van der Meer
I am producing a series of files in a shell script with mtxrun --autogenerate 
--script context input
Doing exit mtxrun... shows there is no exit number to test in the shell, or to 
ste a shell variable to that value.

I can set a global macro \ExitStatus to an exit value depending on success or 
failure, pass that on to mtxrun as exit statusd and test that in the script.

For example:
\starttext
  \xmlprocessbuffer{notes}{notes}{}
  \doif{\ExitStatus}{notok}{"let mtxrun return value 1 as error in UNIX"}
\stoptext

After that it would be possible in the shell script to delete the pdf produced, 
what is my intention in this case.

Is this an option or is there presently another (standard) procedure to 
communicate from ConTeXt to the shell.

dr. Hans van der Meer


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___