problem debugging xset command inside batch script

2008-02-18 Thread 6kbnowe02
I am trying to write a Windows batch file to automate the process of
starting up Mathematica on a remote computer while displaying the
application's X front end on my laptop PC which is running Cygwin/XFree.

My script works correctly when invoked from a Cygwin rxvt window, but does
not work correctly when run from a Windows shortcut.

Actually it's only a small (but critical) part of the script that doesn't
work correctly when run from a Windows command shell or Windows shortcut.
Part of the script involves adding a new font path to my existing X font
path. The part of the script that does this consist of the following two
lines (any line breaks that may appear here due to the mail system are not
in the actual script file):

C:\cygwin\usr\X11R6\bin\xset fp+ "/cygdrive/c/Program Files/Wolfram
Research/Mathematica/6.0/SystemFiles/Fonts/Type1"
C:\cygwin\usr\X11R6\bin\xset fp rehash

As I said, when I run the script containing these lines from a Cygwin rxvt
window, the new font path is added to the existing X font path, but when I
invoke the script from a Windows command shell the new path doesn't get
added.

I've tried adding various escape characters (e.g., extra quotes, extra
backslashes) to the font path name in the script file without any
improvement.

I'm having a hard time trying to determine what is actually happening. For
example, I can see the output from xset commands when I invoke the script
from a Cygwin rxvt window, but they don't show up when I invoke the script
from a Windows command shell.

Any suggestions on how to fix this or debug the problem more successfully?

Thanks,

jjo



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



problem debugging xset command inside batch script (revised)

2008-02-19 Thread 6kbnowe02
I have narrowed the problem down to the following:

It appears that I cannot run the xset command with the options I need from a
Windows/DOS command shell or batch file. For example, when I enter the
command 
xset -q
the response is
xset:  unable to open display ""
The same is true even if the xset command is called from within a bash shell
script which itself is called from a Windows/DOS shell. So it's not due to
bash or DOS. Rather, it's because the calling program doesn't have an X
display to communicate with.

As confirmation of this, I observe that the problem does not occur when I
call the same script from a Cygwin/rxvt shell because this shell has an X
display already defined.

It would be nice to be able to update the X font path on the fly and only
when I want to start up this particular application, but short of that,
adding the necessary font path to the permanent X font path would be OK too.
How do I do that?

Thanks,

jjo



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/