<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Januka,<br>
    <br>
    Here's one way to do it.&nbsp;&nbsp; This is from a bash script that invokes
    sac to change the "a" and "f" headers:<br>
    <br>
    echo -e "r $sacfile \n ch a $a_time \n ch F $F_time \n wh \n exit" |
    sac<br>
    <br>
    I'd bet there are much more elegant ways to do it too.&nbsp;&nbsp; <br>
    <br>
    -Derek<br>
    <br>
    <br>
    On 10/25/2010 10:20 AM, Januka Attanayake wrote:
    <blockquote
      cite="mid:AANLkTingM0pHAcwt87=ZAYsmczqweLTyLSkmBkVWpS5S@mail.gmail.com"
      type="cite">Greetings, <br>
      I am trying to call sac within a shell script as follows. <br>
      <br>
      while read line<br>
      do<br>
      &nbsp;&nbsp;&nbsp; cd $line<br>
      &nbsp;&nbsp; <br>
      &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; sac<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gawk '{print "macro ../sac_cut.macro"}'<br>
      <br>
      &nbsp;&nbsp;&nbsp; cd ../<br>
      done &lt; folder_list.txt <br>
      <br>
      <br>
      folder_list.txt holds the names of all the directory names that
      the script is suppose to look in. <br>
      I see that sac is initiated but the problem is in executing
      commands within sac once it is initiated. I have tried several
      ways of doing that including printf and piping to sac with back
      quotes. Still I get the following error. <br>
      <br>
      SAC&gt; readline: readline_callback_read_char() called with no
      handler!<br>
      <br>
      How should one execute sac commands within a shell script? <br>
      <br>
      I am using sac Version 101.3b<br>
      <br>
      Thanks a lot.<br>
      <br>
      Januka.<br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
sac-help mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sac-help@iris.washington.edu">sac-help@iris.washington.edu</a>
<a class="moz-txt-link-freetext" href="http://www.iris.washington.edu/mailman/listinfo/sac-help">http://www.iris.washington.edu/mailman/listinfo/sac-help</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
--------------------
Derek Schutt
Assistant Professor
Geosciences Department
309 Natural Resources Building
Campus Delivery 1482
Fort Collins, CO 80525-1482
<a class="moz-txt-link-freetext" href="http://warnercnr.colostate.edu/~schutt/CSU_web/index.htm">http://warnercnr.colostate.edu/~schutt/CSU_web/index.htm</a>
970-491-5786
</pre>
  </body>
</html>