MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: kernel running programs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33104] Re: kernel running programs
  • From: Alexander Dreyer <dreyer at itwm.fhg.de>
  • Date: Sun, 3 Mar 2002 06:30:26 -0500 (EST)
  • Organization: Fraunhofer ITWM
  • References: <a5nq14$r69$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Fernando Rinaldi wrote:
> 
> I have a very simple, but for me important, question...
> 
> Suppose that I wrote this easy program:
> 
> a=20;
> b=30;
> Print[a+b]
> 
> If I want to use the kernel: 'math' (I use Linux)
> 
> in which way I have to pass it this instructions...of course I don't
> want to do it by hands (cause I want to use 'math' as command in my
> Linux Debian system), so in what way is possible to pass to math a file,
> and in what format I have to write it ?
> 
> To say it again. How is possible to run a programm using directly the
> kernel??
> 
> thank you in advance
> 
> fernando

On Linux you can write a perl script which opens the PIPEHANDLE for you
und 'prints' the commands you wanna execute to the kernel. The script
has to look like this:

---- cut here ----
#!/usr/bin/perl

open(PIPEHANDLE, "| /usr/local/bin/math");
print PIPEHANDLE "a=20;";
print PIPEHANDLE "b=30;";
print PIPEHANDLE "Print[a+b]";
---- cut here ----

You also have to set the executable bit for this script. 

Reagrds
Alexander 

-- 
 / Alexander Dreyer, Dipl.-Math. - Abteilung Adaptive Systeme        \
/  Fraunhofer Institut fuer Techno- und Wirtschaftsmathematik (ITWM)  \
\  Gottlieb-Daimler-Strasse, Geb. 7^2=49/302  D-67663 Kaiserslautern  /
 \ http://www.itwm.fhg.de    Tel.:(0631)205-4472  Fax:(0631)205-4139 /


  • Prev by Date: Re: Notebooks and CVS: how to automatically strip output?
  • Next by Date: suse 7.3 font problems
  • Previous by thread: Re: kernel running programs
  • Next by thread: Re: kernel running programs