[SAC-HELP] run sac macro in a shell script

Metin Kahraman metin.kahraman at boun.edu.tr
Fri Nov 22 05:29:07 PST 2013


Dear sac users,

I having a problem which you may come across before with the error. my 
problem is, I would like to run simple sac macro in a shell scrip. the 
reason of this if I have too much file in the folder sac macro gives a 
segmentation fault which I can not relate with anything. so I am trying 
to give sac file 3 component by 3 component in the sac macro.

But the thing is I do this, setbb command in the macro does not work. I 
attached my shell and macro files,

any help will be grateful,
Metin Kahraman
_shell _
#!/bin/bash

mkdir done_events
mkdir tmp
#mkdir Trash

for filename in *1.sac
do
ls $filename > out11
vert=`cut -c 1-19 out11`1.sac
north=`cut -c 1-19 out11`2.sac
east=`cut -c 1-19 out11`3.sac
#######################################################
if [ -f $vert ] && [ -f $north ] && [ -f $east ]; then
 echo ====exissttt======
 sac << EOF
 macro pick_v1.mac file $filename
EOF
else
 echo ===$filename==component missing=====
 echo ======does not exisst=====
 #mv $vert $north $east MISSING-COMPONENTS
fi
rm out11
done


*_sacmacro_*
*
$keys file
$default file " "
echo on
qdp off
ygrid on

 setbb vert $file
 setbb data (substring 1 19 '$file$')
 setbb east '( CHANGE '1.sac' '3.sac' %vert )'
 setbb north '( CHANGE '1.sac' '2.sac' %vert )'

r %vert %east %north
ppk bell off
 setbb ans (REPLY " 1- CONTINUE, 2- NEXT or 3- DELETE the waveform ")
 if %ans eq 1 then
   ppk
 endif

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


More information about the sac-help mailing list