[SAC-HELP] SC (System Command) using an escape character (@) in a macro does not work

Nancy_Collins at URSCorp.com Nancy_Collins at URSCorp.com
Wed Mar 14 15:48:14 PDT 2007



I am using some SAC applications that have been developed elsewhere and
work on SunOS Unix.  I am running sac2000 on SunOS 5.8.

I have a problem when a macro issues a "system command" (sc) that needs an
escape character before a character that would otherwise be interpreted by
SAC.  The command that is passed to Unix does have the escape character
removed but it is not interpreted correctly by Unix.

For example, the following command returns an syntax error for the awk
portion of it:

      sc grep 6.0_8.0 %file_vel% | awk '{print "setbb v0 " @$3}' > junk;  m
junk

As a simpler test is issued the following set of commands from within SAC:

      sc grep 6.0_8.0 %file_vel% > xx
      sc cat xx
      sc set info = `cat xx`
      sc echo @$info

The 2nd line, the "cat xx" does print the contents of the file xx correctly
but the 4th line only prints a blank line, not the contents of the variable
info.  When I do the same thing outside of SAC at the system prompt, the
variable info contains the contents of the file xx.

Any guidance would be appreciated.

Nancy
-----------------------------------
Nancy F. Collins
URS Corporation
566 El Dorado Street, Suite 200
Pasadena, CA  91101
(626) 449-7650; FAX (626) 449-3536

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20070314/9c5ec0f3/attachment.html>


More information about the sac-help mailing list