Thread: unable to detect initialization macro

Started: 2019-03-25 23:30:34
Last activity: 2019-03-26 16:24:21
Topics: SAC Help
Mochammad Husni Rizal
2019-03-25 23:30:34
Hello everyone,

I have managed to run sac on my bash terminal,
but then after trying to run initialization macro that I made following the README file (inside SACHOME directory) by adding this command

lh columns 2 files none; qdp 10000 ; xdiv power off ; xlabel 'Time (sec)'
setmacro /usr/local/macros ; transcript history file ./.sachist

on /usr/local/macros/init.m , and then adding

alias sac '${SACHOME}/bin/sac /usr/local/macros/init.m’

on my bashrc profile and the sourcing it, I got this

-bash: alias: sac: not found
-bash: alias: ${SACHOME}/bin/sac /usr/local/macros/init.m: not found

but then I changed the alias command into this

alias alias_name=‘sac' '${SACHOME}/bin/sac /usr/local/macros/init.m’

yet the second error persists. What should I do?


Warm regards,
Mochammad Husni Rizal





  • George Helffrich
    2019-03-26 14:14:22
    Dear Mochammad Husni Rizal -

    Use double quotes in your alias command (the first try you reported). In bash (and most other shells), shell variables (like ${SACHOME} are NOT expanded when enclosed in a single-quoted string. Shell variable expansion happens in double quoted strings, however.

    On 26 Mar 2019, at 00:55, Mochammad Husni Rizal <mochusnir<at>gmail.com> wrote:

    Hello everyone,

    I have managed to run sac on my bash terminal,
    but then after trying to run initialization macro that I made following the README file (inside SACHOME directory) by adding this command

    lh columns 2 files none; qdp 10000 ; xdiv power off ; xlabel 'Time (sec)'
    setmacro /usr/local/macros ; transcript history file ./.sachist

    on /usr/local/macros/init.m , and then adding

    alias sac '${SACHOME}/bin/sac /usr/local/macros/init.m’

    on my bashrc profile and the sourcing it, I got this

    -bash: alias: sac: not found
    -bash: alias: ${SACHOME}/bin/sac /usr/local/macros/init.m: not found

    but then I changed the alias command into this

    alias alias_name=‘sac' '${SACHOME}/bin/sac /usr/local/macros/init.m’

    yet the second error persists. What should I do?


    Warm regards,
    Mochammad Husni Rizal





    ----------------------
    SAC Help
    Topic home: http://ds.iris.edu/message-center/topic/sac-help/ | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

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



    George Helffrich
    george<at>elsi.jp


  • Geo .
    2019-03-26 16:24:21
    Hello Mochammad,
    My ~/.bash_profile looks like the following. As George mentioned, it's very
    likely that your syntax is off.

    # SAC101.6A MAY 2013

    export SACHOME='/usr/local/sac'

    . ${SACHOME}/bin/sacinit.sh

    export SACAUX="${SACHOME}/aux"

    export PATH="${SACHOME}/bin:${PATH}"


    Januka

    Januka Attanayake
    Research Fellow | Earthquake Seismology
    Homepage: *https://sites.google.com/site/janukaattanayake
    https://sites.google.com/site/janukaattanayake*

    School of Earth Sciences | McCoy Bldg. 200
    University of Melbourne | Parkville 3010 VIC
    Australia




    On Tue, 26 Mar 2019 at 02:55, Mochammad Husni Rizal <mochusnir<at>gmail.com>
    wrote:

    Hello everyone,

    I have managed to run sac on my bash terminal,
    but then after trying to run initialization macro that I made following
    the README file (inside SACHOME directory) by adding this command

    lh columns 2 files none; qdp 10000 ; xdiv power off ; xlabel 'Time (sec)'
    setmacro /usr/local/macros ; transcript history file ./.sachist

    on /usr/local/macros/init.m , and then adding

    alias sac '${SACHOME}/bin/sac /usr/local/macros/init.m’

    on my bashrc profile and the sourcing it, I got this

    -bash: alias: sac: not found
    -bash: alias: ${SACHOME}/bin/sac /usr/local/macros/init.m: not found

    but then I changed the alias command into this

    alias alias_name=‘sac' '${SACHOME}/bin/sac /usr/local/macros/init.m’

    yet the second error persists. What should I do?


    Warm regards,
    Mochammad Husni Rizal





    ----------------------
    SAC Help
    Topic home: http://ds.iris.edu/message-center/topic/sac-help/ |
    Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

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


06:04:34 v.b3198453