Linux store macro from command line

is it possible to store a libreoffice calc macro from the command line on linux ?
if so how please

If you are talking of BASIC “macros”:
They are stored module by module in the ‘basic/Standard’ folder of your user profile as ModuleName.xba files. If you want to insert a macro into an existing module, you will have to use a text editor. The files contain plain text (Unix style) enclosed in a bit of XML.
Better abstain from this as @karolus advised.

additional to @Lupp

…but unfortunatly you have not only to dump the raw-Basic-code – no – you need to replace widely used chars by their xml-Entities:

& →→ &
'  →→ '
" →→ "
etcpp.

not only that – you need also to edit some files around with Meta-data.

and the moral of the story : don’t go this way!!

Thanks! I should have thought of that replacement needs (and mention them). On the other hand I sometiimes tampered with the basic/Standard folder and did not experience errors possibly caused by unadapted meta information. Do you know a text describibg this aspect to more detail?

Hi

An extension would be easier to install and could solve your need?

Regards