Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: how to run a shell command in mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46059] Re: [mg46038] how to run a shell command in mathematica?
  • From: Yasvir Tesiram <tesiramy at omrf.ouhsc.edu>
  • Date: Wed, 4 Feb 2004 02:29:30 -0500 (EST)
  • References: <200402030821.DAA17406@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

First thing that springs to mind is;

Run["chmod a+x some-file"]

A couple of other things spring to mind;
1. Make sure that SetDirectory has been used prior to Run or specify the
full path to the file.
2. The command above will return the status code of the operation, 0 for
success. If you get anything else then something went awry.
3. You can Run["ls -al"] to check the permissions. But note, that you will
not get anything in the Notebook interface. You will need to redirect the
output of "ls -al", i.e. Run["ls -al > tmp.out"] or similar, then read it
into the Mathematica notebook however you please.

Cheers
Yas

On Tue, 3 Feb 2004 sunyb at ustc.edu wrote:

> Hi,
> I want to change some file's mode such as "chmod a+x some-file" in
> mathematica, what should i do?
>
> thx!
>


  • Prev by Date: simplifying first-order diff eq solution
  • Next by Date: Re: help for time series basic operations
  • Previous by thread: how to run a shell command in mathematica?
  • Next by thread: Re: how to run a shell command in mathematica?