gandalfhat
gandalfhat

Reputation: 3

Is there Octave's equivalent for iPython's "!"

For example,

!vim

in iPython opens vim. Is there such a thing in Octave?

Upvotes: 0

Views: 253

Answers (2)

carandraug
carandraug

Reputation: 13091

If you only want to run another process then , the already suggested system() or exec() should work.

However, if you plan on using this to simply open up a text editor and edit an Octave file, set the value of EDITOR with EDITOR ("vim") (you can add this to your .octaverc file) and then use edit (foo) to open up the foo function on the text editor.

Upvotes: 1

Appleman1234
Appleman1234

Reputation: 16096

The following might work system("vim");

If you want the interactivity of calling something inside of Octave and interactivity with it directly try exec("vim") instead.

See Controlling Subprocesses for more examples.

Otherwise you can either combine calls to system, fork and exec or extend octave with Python/iPython or C++.

Upvotes: 1

Related Questions