Message Boards Message Boards

0
|
4627 Views
|
1 Reply
|
4 Total Likes
View groups...
Share
Share this post:

Opening terminal with command

Dear all,

I'm using Mac OSX, newest El Capitan with newest Mathematica. I know I can open a Terminal like this:

SystemOpen["/Applications/Utilities/Terminal.app"]

And this process will not be killed once I close Mathematica (which I need).

Is there a possibility to run something in that Terminal? i.e. give it some extra commands as arguments? I've been trying a few permutations of command with different brackets and quotes but I always get $Failed.

POSTED BY: Sander Huisman
Posted 9 years ago

You can use Run command to execute shell commands. If you want to close the Terminal, you can set your preferences to close the shell if exited cleanly in the Preferences settings. In Mathematica you can write-

Run["osascript -e 'quit app \"Terminal\"'"]

Check out KillProcess command too.

POSTED BY: Girish Arabale
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract