Maxima and regex



Volker van Nek <volkervannek at gmail.com> writes:

> 2013/1/10 Sean <seany at uni-bonn.de>:
>> Hello all
>>
>> Thanks for the replies, yes unfortunately I need regex, for analyzing some
>> strings, in string form.
>>
>> I will play around with sregex package, btw, is there a way for Maxima to
>> call external scripts (say perl), and get the output programetically, i.e.
>> not by pipe symbol, which one uses in the command line manual call?
>
> Maybe the system command allows what you want.
>
> (%i1) system("echo -n 'Maxima' | base64");
> TWF4aW1h
> (%o1)                                  0
> (%i2) system("pwd");
> /home/volker
>
> I run Maxima in a Linux terminal. This doesn't seem to work in
> wxMaxima or XMaxima. system("cd Foo"); wouldn't have any effect
> because you always get a new system thread (if I am not mistaken).

However:

Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) system("cd /");
(%o1)                                  0
(%i2) system("pwd");
/home/rupert
(%o2)                                  0
(%i3) system("cd /; pwd");
/
(%o3)                                  0

I don't know how to get the results back into Maxima very easily. One
option might be to write to a file using ">foo.txt" in the shell command
and then read it in afterwards. But yuck.


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20130110/41cce8ed/attachment.pgp>;