[Thread Prev][Thread Next][Index]

[ferret_users] reusing information from variable definitions



Hi all—

I am looking for a way to use information of a variable without user
intervention (in a script).  For instance,

  let/units="m/s" aa = 123.
  let bb = aa + 666.
  sh var bb
bb = AA + 666.

Recently, Ansley pointed out that even more information can be
retrieved from variables, e.g. by SHOW VARIABLE/TREE.  But can I use
any of this information?  Say, that I want to define a third variable
cc as bb but with the units bb's terms that I don't know, so

  say `bb,return=original_definition`
aa + 666.
  let/title="`bb,return=original_definition`" cc = bb

I also want to get to use aa.units, by referring only to bb (I don't
know aa).  If a return function or method exists to retrieve the
information, I could then just spawn AWK:

  def symb Units = spawn( "echo '`bb,return=original_definition`' | awk '{ print $1 }'" )
  let/title="Original expression: `bb,return=original_definition`"/units="($Units)" cc = bb

To recap: my goal is to get the units from a previous expression; to
that end, I think I need a way to make use of SHOW VARIABLE[/TREE]
information, or even more generally stdout.  Is there a last-output
symbol, maybe?  (There is FER_LAST_ERROR.)

—Marco


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement