Thread: Re: SAC in a shell script issue -SOLVED

Started: 2014-05-08 22:41:39
Last activity: 2014-05-08 22:41:39
Topics: SAC Help
Geo .
2014-05-08 22:41:39
Thanks all, the issue is solved with WRITEHDR instead of WRITE HEADER, a
syntax error on my part.

J.


On 8 May 2014 11:44, Januka Attanayake <jattanayake<at>gmail.com> wrote:

Hello,
I have the following short piece of SAC code embedded in a shell script,
in which I use variables declared in the shell script to write SAC
parameters (e.g. sac file name, latitude, longitude). The issue is that,
while the script runs as expected, the header variables don't get written.
I also made an attempt of running this part as a macro by echo'ing these
lines and generating a macro but the result was exactly the same. Can I not
use shell variables with CHNHDR function? I am using SAC Version 101.6 on
Mac OS X 10.8.

SAC <<EOF
READTABLE FREE CONTENT XY tmp1.txt
WRITE $sacfile_name
READ $sacfile_name
CHNHDR EVLA $eqlat EVLO $eqlon
WRITE HEADER
QUIT
EOF

Many thanks !

Januka.


--
Januka Attanayake
Postdoctoral Research Associate
Laboratório de Sismologia
Complexo Interdisciplinar
Departamento de Física
Instituto Superior Técnico
Av. Rovisco Pais, 1
1049-001 Lisboa, Portugal

Honorary Research Associate
University College London

University email: januka.attanayake<at>ist.utl.pt
Homepage: http://sites.google.com/site/janukaattanayake/




--
Januka Attanayake
Postdoctoral Research Associate
Laboratório de Sismologia
Complexo Interdisciplinar
Departamento de Física
Instituto Superior Técnico
Av. Rovisco Pais, 1
1049-001 Lisboa, Portugal

Honorary Research Associate
University College London

University email: januka.attanayake<at>ist.utl.pt
Homepage: http://sites.google.com/site/janukaattanayake/

16:22:53 v.01697673