Thread: Passing commands to SAC using sac<<eof

Started: 2006-10-11 06:30:39
Last activity: 2006-10-27 21:29:11
Topics: SAC Help
andreas wessel
2006-10-11 06:30:39
Good evening,

I'm trying to pass some commands to SAC with <<
But all I get is the SAC startup lines:

SEISMIC ANALYSIS CODE [06/06/2005 (Version 100.1)]
Copyright 1995 Regents of the University of California

.. and a blinking cursor a few lines below. All I can do then is kill the
script with Ctrl+C.
I am running a minimal example. I get the "echo start", it's only the SAC
part that causes trouble.

#!/bin/sh
echo start
sac<<eof
r test.e
p
q
eof
exit 0

I also tried csh instead of sh, but that didn't help.
Are there any environmental things besides SACAUX I need to consider?

Thanks,
Andreas

  • andreas wessel
    2006-10-27 21:29:11
    Hi,

    I still could not solve this one, but I heard from someone else who has the
    same problem.
    I just found out that it works with Sac 100.0 but not with 100.1.

    sac << eof
    funcgen seis
    w test
    eof

    I get the file on my harddisk and end up back in my terminal with sac 100,
    but if i try the above with sac 100.1 it does not work.

    On 10/10/06, andreas wessel <awbochum<at>gmail.com> wrote:

    I'm trying to pass some commands to SAC with <<
    But all I get is the SAC startup lines:


    I'm passing the commands to sac through a file now. The downsite of this is
    that you have to create a file for every operation that is done in sac.

    #!/bin/sh
    /usr/local/bin/sac /seismo/macros/test.init $1 <------- here I'm passing
    the sac commands in test.init
    # end of test
    exit 0

    Is there any way to make the command passing work in Sac 100.1?

    Thanks,
    Andreas

Page built 06:43:51 | v.b'ea7a92