Saturday, May 4, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 567  / 1 Year ago, fri, april 28, 2023, 11:52:33

In the apt version of octave, I can use the command octave script.m to execute the file script.m. Similarly flatpak run org.octave.Octave script.m works too.


However, to avoid the long command flatpak run org.octave.Octave, I created a file ~.local/bin/octave with the contents flatpak run org.octave.Octave, and marked it as executable (I already removed the apt version of Octave). While it runs octave just fine, octave script.m does not work anymore, it only opens the command line version of Octave.


I know that I can open Octave and run the script from within, but I am interested to know if the script can be directly run from terminal with the flatpak version of Octave.


More From » command-line

 Answers
5

I have just installed Octave 6.4.0 from Flatpak on my Ubuntu 20.04.3 LTS system, then rebooted and I'm able to execute my script.m file from terminal from both MATE and GNOME as simple as:


flatpak run org.octave.Octave script.m

Or create a wrapper script by


cat <<'EOF' | tee ~/.local/bin/octave
#!/bin/bash
flatpak run org.octave.Octave "$@"
EOF

chmod +x ~/.local/bin/octave

and call Octave from Flatpak by executing octave script.m. Make sure that ~/.local/bin is defined in your $PATH variable.


Note: make sure that you do not have both deb- and Flatpak-versions of Octave. Remove the first by sudo apt-get autopurge octave if you prefer Flatpak.




If Flatpak fails on your system, you can install Octave 6.4.0 from some PPA by executing below commands:


sudo add-apt-repository ppa:devacom/science
sudo apt-get update
sudo apt-get install octave

[#881] Saturday, April 29, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
earxcept

Total Points: 310
Total Questions: 115
Total Answers: 111

Location: Japan
Member since Sat, Oct 2, 2021
3 Years ago
;