octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

M4 Macro OCTAVE_EVAL


From: Erik de Castro Lopo
Subject: M4 Macro OCTAVE_EVAL
Date: Mon, 9 Feb 2009 10:31:31 +1100

Hi all,

I'm not sure where I got it, but I'm using the OCATVE_EVAL M4 macro
in my configure script. The macro looks like this:

    AC_DEFUN([OCTAVE_EVAL],
    [
    AC_MSG_CHECKING([for $1 in $OCTAVE])
    $2=`echo "PS1 (\"\"); disp($1)" | $OCTAVE -qfH`
    AC_MSG_RESULT($$2)
    AC_SUBST($2)
    ]) # OCTAVE_EVAL

and I'm using it to grab the octave version like this:

    OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION)

This works fine up to and including octave 3.0.1, but for version
3.0.3, "disp (OCTAVE_VERSION)" has some extra escape characters
so that I get this:

    echo "disp(OCTAVE_VERSION)" | octave -qfH | hexdump -C

    00000000  1b 5b 3f 31 30 33 34 68  33 2e 30 2e 33 0a        |.[?1034h3.0.3.|

Is there anyway I can turn off those extra escape characters? I
tried setting PS1, but that didn't help. I know I could use
"octave -v" for this, but there are potentially other values
I would like to grab in this way.

Cheers,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Within C++, there is a much smaller and cleaner language struggling
to get out." -- Bjarne Stroustrup


reply via email to

[Prev in Thread] Current Thread [Next in Thread]