Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Running the kernel command line with additional input files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61663] Re: Running the kernel command line with additional input files
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Mon, 24 Oct 2005 21:07:26 -0400 (EDT)
  • References: <djhsok$shl$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

kalymereau at yahoo.fr wrote:
> Hi MathGroup
> 
> I have a package myPack.m that reads input from two text files
> file1.txt file2.txt
> 
> The names of the files will change from job to job and thus have to be
> given by the user.
> 
> Thus I would like to run something like
>    math < myPack.m (whatever) file1.txt file2.txt
> 
> I have tried with Input[] instructions in myPack.m but it doesn't work.
> 
> How could I do that ?
> 
> Thanks
> 
Hello,

As an example, the following command will run the kernel on the given .m 
file without displaying anything:

"c:\program files\wolfram research\mathematica\5.1\Mathkernel" -mathlink 
-initfile test1.m


I think the command line details are a bit system dependant.

To feed in some data files, you could either use the -run option to 
specify a starting command, or it might be easier to set the name of the 
file in an environment variable and then pick this up inside your code 
using the Environment function.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Running the kernel command line with additional input files
  • Next by Date: Re: 'Raw Expressions'
  • Previous by thread: Re: Running the kernel command line with additional input files
  • Next by thread: Re: Running the kernel command line with additional input files