[NTG-context] First hack at new ruby-aware texexec script for linux/unix

gnwiii at gmail.com gnwiii at gmail.com
Wed May 17 22:54:34 CEST 2006


There are two classes of users:

1) most error messages are ignored up to and including the ones that
promise global thermonuclear war if you click on "Yes", or

2) minor warnings bring all work to a halt until explained.

In honor of the latter class, who ask about the suggestion to use
"texstart texexec.rb ..."
when running context, the following script may be helpful.

TeX Live on linux runs texexec, etc. via a shell script that is linked
to the names of various
perl utilities.  Here is my first cut at a version that tries to use
the ruby scripts:

 ------------------------------------------------------------------
#!/bin/sh
# use ruby and texmfstart.rb or perl
# to use: link to the names of ConTeXt scripts

what=`echo $0 | sed 's at .*/@@'`

case $what in
texmfstart|texexec|pstopdf|textools|texutil)
  p=`kpsewhich -format=texmfscripts $what.rb`
  { test -n "$p" && test -f "$p"; } \
   || { echo "\`$what.rb' not found."; exit 1; }
  RUBYLIB="${RUBYLIB:-${p%/*}}"
  export RUBYLIB
  exec ruby "$p" ${1+"$@"}
  ;;
*)
  p=`kpsewhich -format=texmfscripts $what.pl`
  { test -n "$p" && test -f "$p"; } \
   || { echo "\`$what.pl' not found."; exit 1; }
  exec perl "$p" ${1+"$@"}
  ;;
esac
 -------------------------------------------------------

This version runs the ruby scripts directly, rather than the suggested
form, e.g., "texfmstart pstopdf.rb file.ps".  I have no idea if that
is intended to work -- it did in my very simple tests .  I'm not sure
the RUBYLIB line is needed.

-- 
George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia


More information about the ntg-context mailing list