PowerShell Commands Not Working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PowerShell Commands Not Working

Richard Obregon

Hello,

 

I have been using PowerShell for some time and would like to make my life easier by using Octave as a simple line command to initiate the protocol for Octave. I have tried using “octave” as a one-line command (similar to python) but it is giving me an error. I have added the entire directory for octave in the PATH. Is there something I have missed for what I need to do or what is the name of the .exe for the 5.1.0 release? Because my understanding is that the PATH needs to include the directory for the .exe and just typing “octave” should open octave.exe. Is there a different name for this release?

 

Thanks,

Ricky Obregon

 

Sent from Mail for Windows 10

 



Reply | Threaded
Open this post in threaded view
|

Re: PowerShell Commands Not Working

siko1056
On 10/25/19 3:33 AM, Richard Obregon wrote:

> Hello,
>
>  
>
> I have been using PowerShell for some time and would like to make my
> life easier by using Octave as a simple line command to initiate the
> protocol for Octave. I have tried using “octave” as a one-line command
> (similar to python) but it is giving me an error. I have added the
> entire directory for octave in the PATH. Is there something I have
> missed for what I need to do or what is the name of the .exe for the
> 5.1.0 release? Because my understanding is that the PATH needs to
> include the directory for the .exe and just typing “octave” should open
> octave.exe. Is there a different name for this release?
>
>  
>
> Thanks,
>
> Ricky Obregon
>
The better way to go is to call

   C:\Octave\Octave-5.1.0.0\mingw64\bin\octave.bat

which setups some necessary paths in cmd.exe and PowerShell and define
some alias for it.  Then you can pass commands to Octave by adding for
example:

   --eval "format long; sin (pi/2) + 4"

and get the output to the respective MS Windows shell.  But some small
experiments showed that PowerShell does not properly pass the --eval
input to Octave and causes errors, which I have no clue how to
fix/properly escape them at the moment.

   --eval "sin(pi)"

If you have a satisfying solution accepting arbitrary input, please
share it with us =)

HTH,
Kai


Reply | Threaded
Open this post in threaded view
|

RE: PowerShell Commands Not Working

Richard Obregon

Sorry for the delay in response. Thank you for that information! I did not realize it was a .bat. Thank you! I will look into refining the command, I appreciate it!

 

Respectfully,

Ricky Obregon

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, October 24, 2019 9:09 PM
To: [hidden email]; [hidden email]
Subject: Re: PowerShell Commands Not Working

 

On 10/25/19 3:33 AM, Richard Obregon wrote:

> Hello,

>

>  

>

> I have been using PowerShell for some time and would like to make my

> life easier by using Octave as a simple line command to initiate the

> protocol for Octave. I have tried using “octave” as a one-line command

> (similar to python) but it is giving me an error. I have added the

> entire directory for octave in the PATH. Is there something I have

> missed for what I need to do or what is the name of the .exe for the

> 5.1.0 release? Because my understanding is that the PATH needs to

> include the directory for the .exe and just typing “octave” should open

> octave.exe. Is there a different name for this release?

>

>  

>

> Thanks,

>

> Ricky Obregon

>

The better way to go is to call

 

   C:\Octave\Octave-5.1.0.0\mingw64\bin\octave.bat

 

which setups some necessary paths in cmd.exe and PowerShell and define

some alias for it.  Then you can pass commands to Octave by adding for

example:

 

   --eval "format long; sin (pi/2) + 4"

 

and get the output to the respective MS Windows shell.  But some small

experiments showed that PowerShell does not properly pass the --eval

input to Octave and causes errors, which I have no clue how to

fix/properly escape them at the moment.

 

   --eval "sin(pi)"

 

If you have a satisfying solution accepting arbitrary input, please

share it with us =)

 

HTH,

Kai