[SAC-HELP] calling sac commands within shell scripts

Januka Attanayake jattanayake at gmail.com
Mon Oct 25 11:21:44 PDT 2010


Hi again,
I've had a couple of responses from the members, thanks for your time!
However, none of them worked. I still get the same error. I am calling sac
within a while read line loop. Should there be a special way of calling sac
and executing commands if I do it in a loop? I haven't come across this
problem with other programs like GMT and taup at all.

my error msg: SAC> readline: readline_callback_read_char() called with no
handler!

and bash script:

while read line
do
    cd $line

        sac
        gawk '{print "macro ../sac_cut.macro"}'

    cd ../
done < folder_list.txt

commands I've tried so far:

       (1) echo -e "macro ../sac_cut.macro" | sac

       (2) sac << EOF and  !
            macro ../sac_cut.macro
            EOF and !      ==> doesn't work within a while loop

       (3) printf "macro ../sac_cut.macro" | sac
       (4) echo "macro ../sac_cut.macro" | sac


Thanks again !

Januka.

On Mon, Oct 25, 2010 at 12:20 PM, Januka Attanayake
<jattanayake at gmail.com>wrote:

> Greetings,
> I am trying to call sac within a shell script as follows.
>
> while read line
> do
>     cd $line
>
>         sac
>         gawk '{print "macro ../sac_cut.macro"}'
>
>     cd ../
> done < folder_list.txt
>
>
> folder_list.txt holds the names of all the directory names that the script
> is suppose to look in.
> 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.
>
> SAC> readline: readline_callback_read_char() called with no handler!
>
> How should one execute sac commands within a shell script?
>
> I am using sac Version 101.3b
>
> Thanks a lot.
>
> Januka.
>



-- 
"Nothing can start to exist nor can cease to exist, only transformation is
possible"

Januka Attanayake
Solid Earth Geophysics & Economics
University of Connecticut
Beach Hall   U-2045
354,Mansfield Rd;
Storrs.CT 06269

Tel: +1 860 486 0475 (Office)
      +1 860 486 3914 (Lab - P405)
URL: http://sites.google.com/site/janukaattanayake/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20101025/617e9bf7/attachment.html>


More information about the sac-help mailing list