Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Re: $CommandLine

  • To: mathgroup at
  • Subject: [mg43891] Re: [mg43864] $CommandLine
  • From: "P.J. Hinton" <paulh at>
  • Date: Fri, 10 Oct 2003 03:06:01 -0400 (EDT)
  • Organization: "Wolfram Research, Inc."
  • Sender: owner-wri-mathgroup at

On Thu, 9 Oct 2003, Peter Dickof wrote:

> According to the help file, "$CommandLine is a list of strings giving
> the elements of the original operating system command line with which
> Mathematica was invoked. "
> I have been unable to find the following:
> 1) What exactly do the individual strings mean?
> 2) What are the "elements" allowed for an operating system command?
> 3) How is it possible to use $CommandLine to pass in arbitrary
> strings?
> Can anyone point me to this information?

The value of $CommandLine is meant to be a read-only setting.  It
analogous to the argv[] argument of the main() function in a C program.  
For example, here is the value of $CommandLine for a kernel which was
launched on a Windows system.


{C:\Program Files\Wolfram\
   Research\Mathematica\5.0\MathKernel.exe, -mathlink, 
  -mathlink, -linkmode, connect, -linkname, hcg_shm}

Usually the parameters passed on the command line will not be of any 
meaning to an end user, but it may prove useful in diagnosing technical 
problems with getting a kernel connected to another program.
P.J. Hinton
User Interface Programmer                         paulh at
Wolfram Research, Inc.

  • Prev by Date: RE: Perform an assigment
  • Next by Date: RE: piecewise definition of a function
  • Previous by thread: $CommandLine
  • Next by thread: Re: $CommandLine