Thread: Initialization macro

Started: 2009-06-01 17:16:27
Last activity: 2009-06-01 23:50:19
Topics: SAC Help
Shahar Shani Kadmiel
2009-06-01 17:16:27
Hi,

I am trying to run an initialization macro as sac starts up.
I have created an init.m macro file in the /sac/macro directory and I
am able to run it from within sac by executing the following two
commands:

SETMACRO sac/macro
MACRO init.m

I tried aliasing sac like this:

alias sac='sac sac/macro/init.m'

but it doesn't work and I don't think that it should but this is what
it says to do in the README file for SAC so I tried.

How do I make something run as I call up sac?

Thanks

Shahar

  • Arthur Snoke
    2009-06-01 14:58:33
    In the README file, the absolute path is set for the init.m file. Try using the
    absolute path and see if it finds your init.m.

    Do you have a directory ${SACHOME}/macro? If so, try

    alias sac '${SACHOME}/sac ${SACHOME}/macro/init.m'

    I think your 'SETMACRO sac/macro' command requires that SAC is already running
    before it will be recognized.

    Shahar Kadmiel ??? ?????? wrote:
    Hi,

    I am trying to run an initialization macro as sac starts up.
    I have created an init.m macro file in the /sac/macro directory and I am
    able to run it from within sac by executing the following two commands:

    SETMACRO sac/macro
    MACRO init.m

    I tried aliasing sac like this:

    alias sac='sac sac/macro/init.m'

    but it doesn't work and I don't think that it should but this is what it
    says to do in the README file for SAC so I tried.

    How do I make something run as I call up sac?

    Thanks

    Shahar

    • Guust Nolet
      2009-06-01 21:41:59
      In my case the alias works, but I take care to specify the *complete*
      address of the macro. I use tcsh:

      alias sac '/usr/local/sac/bin/sac /Users/guust/.sacrc'

      Guust Nolet
      nolet<at>geoazur.unice.fr

      Geosciences Azur
      250, Rue Albert Einstein
      06560 Sophia Antipolis
      France
      +33.4.92.94.26.32

      http://geoweb.princeton.edu/people/faculty/nolet/



      On 1 juin 09, at 13:58, Arthur Snoke wrote:

      In the README file, the absolute path is set for the init.m file.
      Try using the absolute path and see if it finds your init.m.

      Do you have a directory ${SACHOME}/macro? If so, try

      alias sac '${SACHOME}/sac ${SACHOME}/macro/init.m'

      I think your 'SETMACRO sac/macro' command requires that SAC is
      already running before it will be recognized.

      Shahar Kadmiel ??? ?????? wrote:
      Hi,
      I am trying to run an initialization macro as sac starts up.
      I have created an init.m macro file in the /sac/macro directory and
      I am able to run it from within sac by executing the following two
      commands:
      SETMACRO sac/macro
      MACRO init.m
      I tried aliasing sac like this:
      alias sac='sac sac/macro/init.m'
      but it doesn't work and I don't think that it should but this is
      what it says to do in the README file for SAC so I tried.
      How do I make something run as I call up sac?
      Thanks
      Shahar
      _______________________________________________
      sac-help mailing list
      sac-help<at>iris.washington.edu
      http://www.iris.washington.edu/mailman/listinfo/sac-help


  • Mei Xue
    2009-06-01 23:50:19
    Hi Shahar,

    You may try:
    alias sac 'sac m sac/macro/init.m'

    see if it works.

    Mei


    2009/6/1 Shahar Kadmiel שחר קדמיאל <kadmiel<at>bgu.ac.il>:
    Hi,

    I am trying to run an initialization macro as sac starts up.
    I have created an init.m macro file in the /sac/macro directory and I am
    able to run it from within sac by executing the following two commands:

    SETMACRO sac/macro
    MACRO init.m

    I tried aliasing sac like this:

    alias sac='sac sac/macro/init.m'

    but it doesn't work and I don't think that it should but this is what it
    says to do in the README file for SAC so I tried.

    How do I make something run as I call up sac?

    Thanks

    Shahar
    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help



Page built 11:08:34 | v.b'ea7a92