Thread: SAC in a shell script with PAUSE

Started: 2016-09-22 18:58:58
Last activity: 2016-09-22 19:24:16
Topics: SAC Help
Geo .
2016-09-22 18:58:58
Hi,
I have the following macro embedded in a shell script, and when I run the
shell script, SAC does not "see" the PAUSE command and the lines below it,
i.e macro is not paused and QUIT is not executed. I have a feeling that
this is a bug. Am I correct? I am using SAC 101.6

sac<<END
R $sacfile
R MORE $synfile
COLOR ON INC L BLUE RED
P2
PAUSE PERIOD OFF
QUIT
END

ERROR MESSAGE:
SAC Error: EOF/Quit
SAC executed from a script: quit command missing
Please add a quit to the script to avoid this message
If you think you got this message in error,
please report it to: sac-help<at>iris.washington.edu

Thanks !

Januka


Januka Attanayake
Postdoctoral Research Associate

Institut für Geophysik
Westfälische Wilhelms - Universität Münster
CorrensstraBe 24
48149 Münster
Germany

University email: jattanayake<at>uni-muenster.de
Homepage: http://sites.google.com/site/janukaattanayake/

  • Milton Plasencia
    2016-09-22 19:07:34
    Hi,

    PAUSE PERIOD OFF

    the help said:

    :PERIOD OFF: Turn period option off. When this option is off, SAC
    pauses until you type a carriage-return.

    i not try the script but seems SAC wait you press carriage return in this case.

    Cheers,

    M.

    * * * * * * * * * * * * * * * * * * * * * * *
    Milton P. PLASENCIA LINARES

    Centro di Ricerche Sismologiche (CRS)
    OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale

    Borgo Grotta Gigante 42/C
    (34010) Sgonico - Trieste - Italia
    Tel: +39 040 2140 156 (Udine)
    Tel: +39 040 2140 256 (Trieste)
    Cel.: +39 331 6481 935

    E-mail: mplasencia<at>inogs.it
    GPG key: 22FCFFA8

    ASAIN (Antarctic Seismographic Argentinean Italian Network)
    *********************************

    On Sep 22, 2016, at 12:00, Geo . <jattanayake<at>gmail.com> wrote:

    Hi,
    I have the following macro embedded in a shell script, and when I run the shell script, SAC does not "see" the PAUSE command and the lines below it, i.e macro is not paused and QUIT is not executed. I have a feeling that this is a bug. Am I correct? I am using SAC 101.6

    sac<<END
    R $sacfile
    R MORE $synfile
    COLOR ON INC L BLUE RED
    P2
    PAUSE PERIOD OFF
    QUIT
    END

    ERROR MESSAGE:
    SAC Error: EOF/Quit
    SAC executed from a script: quit command missing
    Please add a quit to the script to avoid this message
    If you think you got this message in error,
    please report it to: sac-help<at>iris.washington.edu <sac-help<at>iris.washington.edu>

    Thanks !

    Januka


    Januka Attanayake
    Postdoctoral Research Associate

    Institut für Geophysik
    Westfälische Wilhelms - Universität Münster
    CorrensstraBe 24
    48149 Münster
    Germany

    University email: jattanayake<at>uni-muenster.de <jattanayake<at>uni-muenster.de>
    Homepage: http://sites.google.com/site/janukaattanayake/

    ----------------------
    SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

    Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/


    • Geo .
      2016-09-22 19:13:20
      No Milton, it does not pause and sac throws out the error message I copied
      in my earlier message. Yes, if I have something like PAUSE PERIOD 3, it
      works fine. This is why I suspect that it is might be a bug.

      Thanks !

      Januka.

      Januka Attanayake
      Postdoctoral Research Associate

      Institut für Geophysik
      Westfälische Wilhelms - Universität Münster
      CorrensstraBe 24
      48149 Münster
      Germany

      University email: jattanayake<at>uni-muenster.de
      Homepage: http://sites.google.com/site/janukaattanayake/

      On 22 September 2016 at 12:07, Milton Percy Plasencia Linares <
      mplasencia<at>inogs.it> wrote:

      Hi,

      PAUSE PERIOD OFF

      the help said:

      :PERIOD OFF: Turn period option off. When this option is off, SAC
      pauses until you type a carriage-return.

      i not try the script but seems SAC wait you press carriage return in this
      case.

      Cheers,

      M.

      * * * * * * * * * * * * * * * * * * * * * * *
      Milton P. PLASENCIA LINARES

      Centro di Ricerche Sismologiche (CRS)
      OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale

      Borgo Grotta Gigante 42/C
      (34010) Sgonico - Trieste - Italia
      Tel: +39 040 2140 156 (Udine)
      Tel: +39 040 2140 256 (Trieste)
      Cel.: +39 331 6481 935

      E-mail: mplasencia<at>inogs.it
      GPG key: 22FCFFA8

      ASAIN (Antarctic Seismographic Argentinean Italian Network)
      *********************************

      On Sep 22, 2016, at 12:00, Geo . <jattanayake<at>gmail.com> wrote:

      Hi,
      I have the following macro embedded in a shell script, and when I run the
      shell script, SAC does not "see" the PAUSE command and the lines below it,
      i.e macro is not paused and QUIT is not executed. I have a feeling that
      this is a bug. Am I correct? I am using SAC 101.6

      sac<<END
      R $sacfile
      R MORE $synfile
      COLOR ON INC L BLUE RED
      P2
      PAUSE PERIOD OFF
      QUIT
      END

      ERROR MESSAGE:
      SAC Error: EOF/Quit
      SAC executed from a script: quit command missing
      Please add a quit to the script to avoid this message
      If you think you got this message in error,
      please report it to: sac-help<at>iris.washington.edu

      Thanks !

      Januka


      Januka Attanayake
      Postdoctoral Research Associate

      Institut für Geophysik
      Westfälische Wilhelms - Universität Münster
      CorrensstraBe 24
      48149 Münster
      Germany

      University email: jattanayake<at>uni-muenster.de
      Homepage: http://sites.google.com/site/janukaattanayake/

      ----------------------
      SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

      Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
      Update subscription preferences at http://ds.iris.edu/account/profile/




      • Milton Plasencia
        2016-09-22 19:24:16
        You are right, with PAUSE PERIOD OFF give an error and no wait for carriage return.

        Cheers,

        m.



        * * * * * * * * * * * * * * * * * * * * * * *
        Milton P. PLASENCIA LINARES

        Centro di Ricerche Sismologiche (CRS)
        OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale

        Borgo Grotta Gigante 42/C
        (34010) Sgonico - Trieste - Italia
        Tel: +39 040 2140 156 (Udine)
        Tel: +39 040 2140 256 (Trieste)
        Cel.: +39 331 6481 935

        E-mail: mplasencia<at>inogs.it
        GPG key: 22FCFFA8

        ASAIN (Antarctic Seismographic Argentinean Italian Network)
        *********************************

        On Sep 22, 2016, at 12:13, Januka Attanayake <jattanayake<at>gmail.com> wrote:

        No Milton, it does not pause and sac throws out the error message I copied in my earlier message. Yes, if I have something like PAUSE PERIOD 3, it works fine. This is why I suspect that it is might be a bug.

        Thanks !

        Januka.

        Januka Attanayake
        Postdoctoral Research Associate

        Institut für Geophysik
        Westfälische Wilhelms - Universität Münster
        CorrensstraBe 24
        48149 Münster
        Germany

        University email: jattanayake<at>uni-muenster.de <jattanayake<at>uni-muenster.de>
        Homepage: http://sites.google.com/site/janukaattanayake/

        On 22 September 2016 at 12:07, Milton Percy Plasencia Linares <mplasencia<at>inogs.it <mplasencia<at>inogs.it>> wrote:
        Hi,

        PAUSE PERIOD OFF

        the help said:

        :PERIOD OFF: Turn period option off. When this option is off, SAC
        pauses until you type a carriage-return.

        i not try the script but seems SAC wait you press carriage return in this case.

        Cheers,

        M.

        * * * * * * * * * * * * * * * * * * * * * * *
        Milton P. PLASENCIA LINARES

        Centro di Ricerche Sismologiche (CRS)
        OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale

        Borgo Grotta Gigante 42/C
        (34010) Sgonico - Trieste - Italia
        Tel: +39 040 2140 156 (Udine)
        Tel: +39 040 2140 256 (Trieste)
        Cel.: +39 331 6481 935

        E-mail: mplasencia<at>inogs.it <mplasencia<at>inogs.it>
        GPG key: 22FCFFA8

        ASAIN (Antarctic Seismographic Argentinean Italian Network)
        *********************************

        On Sep 22, 2016, at 12:00, Geo . <jattanayake<at>gmail.com <jattanayake<at>gmail.com>> wrote:

        Hi,
        I have the following macro embedded in a shell script, and when I run the shell script, SAC does not "see" the PAUSE command and the lines below it, i.e macro is not paused and QUIT is not executed. I have a feeling that this is a bug. Am I correct? I am using SAC 101.6

        sac<<END
        R $sacfile
        R MORE $synfile
        COLOR ON INC L BLUE RED
        P2
        PAUSE PERIOD OFF
        QUIT
        END

        ERROR MESSAGE:
        SAC Error: EOF/Quit
        SAC executed from a script: quit command missing
        Please add a quit to the script to avoid this message
        If you think you got this message in error,
        please report it to: sac-help<at>iris.washington.edu <sac-help<at>iris.washington.edu>

        Thanks !

        Januka


        Januka Attanayake
        Postdoctoral Research Associate

        Institut für Geophysik
        Westfälische Wilhelms - Universität Münster
        CorrensstraBe 24
        48149 Münster
        Germany

        University email: jattanayake<at>uni-muenster.de <jattanayake<at>uni-muenster.de>
        Homepage: http://sites.google.com/site/janukaattanayake/

        ----------------------
        SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

        Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
        Update subscription preferences at http://ds.iris.edu/account/profile/




        • Brian Savage
          2016-09-22 16:25:38
          Milton and Januka,

          The complexity here is that sac is wrapped in a shell script. In this case a HERE Document or sac receives it input directly through standard input via the shell. Sac is behaving as expected.

          Sac reads the "pause period off" command and then pauses for the next string of text. In the set of commands presented, QUIT is the next text string and this is consumed by the PAUSE command. After that the script ends with "END', and this is where sac complains about "SAC being executed in a script " or "SAC Error EOF/Quit"

          Adding a second QUIT will avoid the "SAC Error EOF/Quit" message.

          Changing the initial QUIT to anything will produce the same results.

          I would either suggest to use "pause period 3" (as previously suggested) or use PPK. PPK will not move on until you have exited from picking mode (with a Q).

          I hope this helps.

          Brian


          On Sep 22, 2016, at 6:25 AM, Milton Plasencia wrote:

          You are right, with PAUSE PERIOD OFF give an error and no wait for carriage return.

          Cheers,

          m.



          * * * * * * * * * * * * * * * * * * * * * * *
          Milton P. PLASENCIA LINARES

          Centro di Ricerche Sismologiche (CRS)
          OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale

          Borgo Grotta Gigante 42/C
          (34010) Sgonico - Trieste - Italia
          Tel: +39 040 2140 156 (Udine)
          Tel: +39 040 2140 256 (Trieste)
          Cel.: +39 331 6481 935

          E-mail: mplasencia<at>inogs.it
          GPG key: 22FCFFA8

          ASAIN (Antarctic Seismographic Argentinean Italian Network)
          *********************************

          On Sep 22, 2016, at 12:13, Januka Attanayake <jattanayake<at>gmail.com> wrote:

          No Milton, it does not pause and sac throws out the error message I copied in my earlier message. Yes, if I have something like PAUSE PERIOD 3, it works fine. This is why I suspect that it is might be a bug.

          Thanks !

          Januka.

          Januka Attanayake
          Postdoctoral Research Associate

          Institut für Geophysik
          Westfälische Wilhelms - Universität Münster
          CorrensstraBe 24
          48149 Münster
          Germany

          University email: jattanayake<at>uni-muenster.de
          Homepage: http://sites.google.com/site/janukaattanayake/

          On 22 September 2016 at 12:07, Milton Percy Plasencia Linares <mplasencia<at>inogs.it> wrote:
          Hi,

          PAUSE PERIOD OFF

          the help said:

          :PERIOD OFF: Turn period option off. When this option is off, SAC
          pauses until you type a carriage-return.

          i not try the script but seems SAC wait you press carriage return in this case.

          Cheers,

          M.

          * * * * * * * * * * * * * * * * * * * * * * *
          Milton P. PLASENCIA LINARES

          Centro di Ricerche Sismologiche (CRS)
          OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale

          Borgo Grotta Gigante 42/C
          (34010) Sgonico - Trieste - Italia
          Tel: +39 040 2140 156 (Udine)
          Tel: +39 040 2140 256 (Trieste)
          Cel.: +39 331 6481 935

          E-mail: mplasencia<at>inogs.it
          GPG key: 22FCFFA8

          ASAIN (Antarctic Seismographic Argentinean Italian Network)
          *********************************

          On Sep 22, 2016, at 12:00, Geo . <jattanayake<at>gmail.com> wrote:

          Hi,
          I have the following macro embedded in a shell script, and when I run the shell script, SAC does not "see" the PAUSE command and the lines below it, i.e macro is not paused and QUIT is not executed. I have a feeling that this is a bug. Am I correct? I am using SAC 101.6

          sac<<END
          R $sacfile
          R MORE $synfile
          COLOR ON INC L BLUE RED
          P2
          PAUSE PERIOD OFF
          QUIT
          END

          ERROR MESSAGE:
          SAC Error: EOF/Quit
          SAC executed from a script: quit command missing
          Please add a quit to the script to avoid this message
          If you think you got this message in error,
          please report it to: sac-help<at>iris.washington.edu

          Thanks !

          Januka


          Januka Attanayake
          Postdoctoral Research Associate

          Institut für Geophysik
          Westfälische Wilhelms - Universität Münster
          CorrensstraBe 24
          48149 Münster
          Germany

          University email: jattanayake<at>uni-muenster.de
          Homepage: http://sites.google.com/site/janukaattanayake/

          ----------------------
          SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

          Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
          Update subscription preferences at http://ds.iris.edu/account/profile/




          ----------------------
          SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

          Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
          Update subscription preferences at http://ds.iris.edu/account/profile/


11:12:15 v.01697673