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: gracebat runs in X, but not as a system call from a perl script


Better now, but still something is missing
cygwin is under c:\cygwin
e.g. c:\cygwin\bin

There I see

\bin\gracebat.exe->/usr/grace/bin/xmgrace.exe

but also the same for /bin/xmgrace.exe


The script directory is c:\cygwin\mydir

so in the perl script
my $updir='..';
my $gracebat=$updir .'/usr/grace/bin/xmgrace ';
system("$gracebat ... -printfile $printfile....");
prints to the screen, not the file.
This looks right to me, since gracebat and xmgrace link to the SAME
 executable, xmgrace.exe.

How can I get $gracebat to do whatit would do on linux, i.e.
 write to a file(I tested this on linux and it works fine)
? 

> 
> > On Wed, 21 Feb 2007, moka wrote:
> > 
> > > I do startxwin to open X and  then do
> > > gracebat <parameters>
> > > this does what I want, namely produce a jpeg file
> > >
> > > Now if I try this for a perl script(run from X)
> > > system(gracebat <parameters>)
> > >
> > > i.e. the exact same line that produced the right result
> > > I get an error.
> > >
> > > I guess the reason is that I am using the activestate perl instead of
> the
> > > cygwin
> > >  perl; anyway there were reasons for that, not sure if valid or not[the
> > reason
> > >  was getting DBD::Oracle to work, which was a huge pain].
> > > So I guess "system" to perl is whatever system Activestate was installed
> > for,
> > > i.e. Windows.
> > >  The question is:
> > > Is it possible to get around this?
> > > Can I tweak the system command so that it executes  gracebat(but
> > >  otherwise use Activestate, e.g.  for Oracle DBI queries?
> > 
> > As the package list shows (I don't have grace installed), gracebat is a
> > symlink.  A Windows program like ActiveState Perl will not understand
> > Cygwin's symlinks (nor will it run a shell script, since it uses cmd as
> > its shell).  The easiest thing you can do is invoke a Cygwin shell (bash,
> > sh, pdksh, etc) and let it run the command.  That way, no matter what the
> > command is (an executable, or a symlink, or a shell script), the shell
> > will interpret it for you and invoke it properly.
> > 
> > Be careful with quoting -- you may want to use the list form of
> > system()...
> > 	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!
> > 
> > Freedom is just another word for "nothing left to lose"...  -- Janis
> Joplin
> > 
> > --
> > 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/
> > 
> > 
> 
> 
> 
> 
> --
> 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/
> 
> 




--
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]