Suppress libreoffice headless command outputs which are not via stdout/stderr - subprocess

Running the following command is outputting to unix terminal, even if stdout/stderr are redirected to a file.
Both commands:
libreoffice --headless --convert-to xlsx <my_file> > 1.tmp
libreoffice --headless --convert-to xlsx <my_file> 2> 1.tmp
Are printing the following to the terminal (and not to 1.tmp):
convert <my_file> using filter : Calc Office Open XML
Overwriting: <out_file>
How can it be that a process prints to the terminal not via stdin/stderr?
How can I suppress those printing? (to be more precise, I'm trying to suppress them through python's subprocess, using stdin=DEVNULL and stdout=DEVNULL - which is unsuccessful).

Related

Can I execute an Octave script from the shell in macOS?

I'm attempting to execute a script from the shell (Mac OS) using Octave, and this is exactly what I type:
$ open -a octave "my_script.m"
The result, is that Octave (the full application in the GUI) opens and doesn't run the script.
Ideally, I'd like Octave to actually run in Terminal (without the GUI), and execute whatever commands and scripts I type there, including, as noted above, an entire script stored in a .m file.
I also tried the following:
$ octave-cli my_script.m
Which produces the following error:
-bash: octave-cli: command not found
I installed Octave through a DMG file linked to on the official GNU website.
The command you're looking for is called octave-cli, and there's no need to open, just octave-cli my_script.m.

process text info displayed by calling a terminal command in Matlab

When I run a terminal command it generates some text data in the terminal display. Suppose blck is some executable software tool installed on my desktop. I call this tool in the terminal on a file named main.txt in the current working directiory like this:-
$ blck -f main.txt
This prints some information immediately below the command call. I have to process this text to glean some information from it. I have the matlab code to process this text. But how to call this terminal command in Matlab and then transfer the resulting text information to Matlab variables. once I have the information displayed from the command call in Matlab then I can simply run my processing code on it.

headless soffice fails silently

I can't get headless soffice to tell me why conversion does not work and I cannot seem to figure out what flags I could pass to get some error output.
Version 1:
/usr/bin/soffice --headless --convert-to pdf test.key --outdir .
Version with all my silly attempts:
HOME=/tmp && /usr/bin/soffice --nologo --nofirststartwizard --headless --convert-to pdf test.key --outdir . > logfile.txt 2>&1
When I run the above I get a silent failure: I execute the command and then there's not console output.
Thoughts?
FYI:
- I'm running this on a Debian server.
- This works perfectly well for PowerPoint conversion.
Make sure that not only are you not running an instance of libreoffice on your pc but also that you have not got the libreoffice Quickstarter module running either, both will result in a silent failure, when trying to do this sort of thing.
Closing other instances of LibreOffice may solve it. It seems to be a bug in LibreOffice.org versions <5.3. You can find an explanation and solutions in
this answer.

Protractor Cucumber : how can I capture web driverjs errors in cucumber html report

I was about to use cucumber-html-report plugin to generate the html reports for my framework but I noticed that the report doesn't print the errors which I see on the Command line- for example -"an element not found for locator..".Rather it prints the time out errors. How can I capture the actual errors that I see on the Command line.
Any advice??
Cheers
you can use the tee command to save the Command line - output to a file while also seeing it on command line
cucumber (+options) | tee -a logFile.txt
It's not as pretty as an html report, but it probably gives you the additional information you want for debugging in an extra file.

mysql-workbench, how do I write a bash file command as to launch and open a SQL script to a query tab?

mysql-workbench, how do I write a bash file command as to launch and open a SQL script to a query tab? I am not sure which parameter I need to pass.
thks
ps. Now I am on a Fedora 32. (kind of very late edit, sorry)
You should always specify which OS you are using.
Generally, you can start MySQL Workbench with various command line paramaters. One of them is --help (-help on Windows). This will give you the following list:
MySQLWorkbench [<options>] [<model file>]
Options:
--query [<connection>] Open a query tab to the named connection or prompt for it if none given
--admin <instance> Open a administration tab to the named instance
--upgrade-mysql-dbs Open a migration wizard tab
--model <model file> Open the given EER model file
--open <file> Open the given file at startup
--run <script> Execute the given code in default language for GRT shell
--run-python <script> Execute the given code in Python
--run-lua <script> Execute the given code in Lua
--migration Open the Migration Wizard tab
--quit-when-done Quit Workbench when the script is done
--log-to-stderr Also log to stderr
--help, -h Show command line options and exit
--log-level=<level> Valid levels are: error, warning, info, debug1, debug2, debug3
--verbose, -v Enable diagnostics output
--version Show Workbench version number and exit
(this is for OS X and Linux, Windows uses a single dash instead). For OS X you also have to use the direct call. So instead of:
open /Applications/MySQLWorkbench.app --args --help
which will not show you the parameters use:
/Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench --help
To open a connection and load an SQL script file use the following parameters:
... --query "Localhost 5.6" --open /Data/Work/Data/Scripts/alter_test.sql
Again, on Windows use single dashes. For the query parameter use the name of a connection you have defined.