Thread: SAC in a shell script issue

Started: 2014-05-08 10:20:35
Last activity: 2014-05-08 10:20:35
Topics: SAC Help
Januka Attanayake
2014-05-08 10:20:35
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 AssociateUniversity College London 

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